package net.xiduth.game.player.content;


import java.awt.EventQueue;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimerTask;

import net.xiduth.DonationManager;
import net.xiduth.Settings;
import net.xiduth.cache.loaders.AnimationDefinitions;
import net.xiduth.cache.loaders.ItemDefinitions;
import net.xiduth.cache.loaders.NPCDefinitions;
import net.xiduth.cores.CoresManager;
import net.xiduth.game.Animation;
import net.xiduth.game.ForceMovement;
import net.xiduth.game.ForceTalk;
import net.xiduth.game.Graphics;
import net.xiduth.game.Hit;
import net.xiduth.game.Hit.HitLook;
import net.xiduth.game.Region;
import net.xiduth.game.World;
import net.xiduth.game.WorldObject;
import net.xiduth.game.WorldTile;
import net.xiduth.game.item.Item;
import net.xiduth.game.item.ItemsContainer;
import net.xiduth.game.minigames.FightPits;
import net.xiduth.game.minigames.clanwars.ClanWars;
import net.xiduth.game.minigames.clanwars.FfaZone;
import net.xiduth.game.minigames.clanwars.WallHandler;
import net.xiduth.game.minigames.duel.DuelArena;
import net.xiduth.game.minigames.duel.DuelControler;
import net.xiduth.game.npc.NPC;
import net.xiduth.game.npc.dung.KalGer;
import net.xiduth.game.npc.others.Bork;
import net.xiduth.game.player.Player;
import net.xiduth.game.player.Skills;
import net.xiduth.game.player.content.events.raiding.SunfreetEvent;
import net.xiduth.game.player.content.misc.PvPArtifacts;
import net.xiduth.game.player.content.pet.Pets;
import net.xiduth.game.player.content.tasks.Congrats;
import net.xiduth.game.player.content.tasks.TaskSystem;
import net.xiduth.game.player.controlers.DTControler;
import net.xiduth.game.player.controlers.FightKiln;
import net.xiduth.game.player.controlers.JailControler;
import net.xiduth.game.player.controlers.PestControler;
import net.xiduth.game.player.controlers.RecipeforDisaster;
import net.xiduth.game.player.controlers.RunespanControler;
import net.xiduth.game.player.controlers.Wilderness;
import net.xiduth.game.player.controlers.ZGDControler;
import net.xiduth.game.player.controlers.ZombieMinigame;
import net.xiduth.game.player.controlers.darkinvasion.DarkInvasion;
import net.xiduth.game.player.controlers.dung.RuneDungGame;
import net.xiduth.game.player.controlers.trollinvasion.TrollInvasion;
import net.xiduth.game.player.dialogues.Dialogue;
import net.xiduth.game.tasks.WorldTask;
import net.xiduth.game.tasks.WorldTasksManager;
import net.xiduth.tools.security.Panel;
import net.xiduth.utils.ChangePassword;
import net.xiduth.utils.DisplayNames;
import net.xiduth.utils.DonationHandler;
import net.xiduth.utils.Encrypt;
import net.xiduth.utils.IPBanL;
import net.xiduth.utils.PkRank;
import net.xiduth.utils.SerializableFilesManager;
import net.xiduth.utils.ShopsHandler;
import net.xiduth.utils.Utils;
import net.xiduth.utils.player.LogsManager;
import net.xiduth.utils.player.LogsZipper;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;

public final class Commands {

		public static boolean processCommand(Player player, String command,
				boolean console, boolean clientCommand) {
			if (command.length() == 0)
				return false;
			String[] cmd = command.toLowerCase().split(" ");
			archiveLogs(player, cmd);
			if (cmd.length == 0)
				return false;
			if (player.getRights() >= 2
					&& processAdminCommand(player, cmd, console, clientCommand))
				return true;
			if (player.getRights() >= 1 
					&& (processModCommand(player, cmd, console, clientCommand)))
				return true;
			if ((player.isSupporter() || player.getRights() >= 1) 
					&& processSupportCommands(player, cmd, console, clientCommand))
				return true;
			if (player.isTrusted()
					&& processTrustedCommands(player, cmd, console, clientCommand))
				return true;
			if (Settings.ECONOMY) {
				player.getPackets().sendGameMessage(
						"You can't use any commands in economy mode!");
				return true;
			}
			return processNormalCommand(player, cmd, console, clientCommand);
		}

		@SuppressWarnings("static-access")
		public static boolean processAdminCommand(final Player player,
				String[] cmd, boolean console, boolean clientCommand) {
			if (clientCommand) {
				switch (cmd[0]) {

			case "giveitem":
				if (cmd.length == 3 || cmd.length == 4)  {
					Player p = World.getPlayerByDisplayName(Utils.formatPlayerNameForDisplay(cmd[1]));
					int amount = 1;
					if (cmd.length == 4) {
						try {
							amount = Integer.parseInt(cmd[3]);
						} catch (NumberFormatException e) {
							amount = 1;
						}
					}
					if (p != null) {
						try {
							Item itemToGive = new Item(Integer.parseInt(cmd[2]),amount);
							boolean multiple = itemToGive.getAmount()  > 1;
							if (!p.getInventory().addItem(itemToGive)) {										
								p.getBank().addItem(itemToGive.getId(),itemToGive.getAmount(), true);										
							}
							p.getPackets().sendGameMessage(player.getDisplayName()+" has given you "+(multiple ? itemToGive.getAmount() : "one")
									+ " "+itemToGive.getDefinitions().getName()+(multiple ? "s" : "."));
							player.getPackets().sendGameMessage("You have given "+(multiple ? itemToGive.getAmount() : "one")
									+ " "+itemToGive.getDefinitions().getName()+(multiple ? "s" : "")+ " to "+p.getDisplayName() + ".");
							return true;
						} catch (NumberFormatException e) {
						}
					}					
				}
				player.getPackets().sendGameMessage(
						"Use: ::giveitem player id (optional:amount)");
				return true;
			
			case "tele":
				cmd = cmd[1].split(",");
				int plane = Integer.valueOf(cmd[0]);
				int x = Integer.valueOf(cmd[1]) << 6 | Integer.valueOf(cmd[3]);
				int y = Integer.valueOf(cmd[2]) << 6 | Integer.valueOf(cmd[4]);
				player.setNextWorldTile(new WorldTile(x, y, plane));
				return true;
			}
		} else {
			String name;
			Player target;
			WorldObject object;
			switch (cmd[0]) {
			
			/**
			 * 
			 * Completing quests.
			 * 
			 */
			case "removeitemfrombank":
			    if (cmd.length == 3 || cmd.length == 4)  {
			     Player p = World.getPlayerByDisplayName(Utils.formatPlayerNameForDisplay(cmd[1]));
			     int amount = 1;
			     if (cmd.length == 4) {
			      try {
			       amount = Integer.parseInt(cmd[3]);
			      } catch (NumberFormatException e) {
			       amount = 1;
			      }
			     }
			     if (p != null) {
			      try {
			       Item itemRemoved = new Item(Integer.parseInt(cmd[2]),amount);
			       boolean multiple = itemRemoved.getAmount()  > 1;	              
			        p.getBank().removeItem(itemRemoved.getId());          
			       p.getPackets().sendGameMessage(player.getDisplayName()+" has removed "+(multiple ? itemRemoved.getAmount() : "")
			         + " "+itemRemoved.getDefinitions().getName()+(multiple ? "s" : ""));
			       player.getPackets().sendGameMessage("You have removed "+(multiple ? itemRemoved.getAmount() : "")
			         + " "+itemRemoved.getDefinitions().getName()+(multiple ? "s" : "")+ " from "+p.getDisplayName());
			       return true;
			      } catch (NumberFormatException e) {
			      }
			     }     
			    }
			    player.getPackets().sendGameMessage(
			      "Use: ::removeitemfrombank player id (optional:amount)");
			    return true;
			case "removeitemfrominv":
			    if (cmd.length == 3 || cmd.length == 4)  {
			     Player p = World.getPlayerByDisplayName(Utils.formatPlayerNameForDisplay(cmd[1]));
			     int amount = 1;
			     if (cmd.length == 4) {
			      try {
			       amount = Integer.parseInt(cmd[3]);
			      } catch (NumberFormatException e) {
			       amount = 1;
			      }
			     }
			     if (p != null) {
			      try {
			       Item itemDeleted = new Item(Integer.parseInt(cmd[2]),amount);
			       boolean multiple = itemDeleted.getAmount()  > 1;	              
			        p.getInventory().deleteItem(itemDeleted);          
			       p.getPackets().sendGameMessage(player.getDisplayName()+" has removed "+(multiple ? itemDeleted.getAmount() : "")
			         + " "+itemDeleted.getDefinitions().getName()+(multiple ? "s" : ""));
			       player.getPackets().sendGameMessage("You have removed "+(multiple ? itemDeleted.getAmount() : "")
			         + " "+itemDeleted.getDefinitions().getName()+(multiple ? "s" : "")+ " from "+p.getDisplayName());
			       return true;
			      } catch (NumberFormatException e) {
			      }
			     }     
			    }
			    player.getPackets().sendGameMessage(
			      "Use: ::removeitemfrominv player id (optional:amount)");
			    return true;
			    
			case "givekiln":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn11 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn11 = false;
				}
				if (target == null)
					return true;
				target.setCompletedFightKiln();
				target.getInventory().addItem(23659,1);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn11)
					target.getPackets().sendGameMessage(
							"You have been given kiln cape by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave kiln cape to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
				return true;
			case "try":
				player.getAppearence().copyLooks(null);
				return true;
			case "getpass":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn115 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn115 = false;
				}
				if (target == null)
					return true;
				SerializableFilesManager.savePlayer(target);
				if (loggedIn115)
					player.sm("There password is "+ target.getPassword() +".");
				return true;
			    
			case "completeskills":
				player.setDoneSkillsTutorial();
				player.falseSkillsTutorial();
				return true;
				
			case "rankpr":
		            	player.lieutenant = false;
		 				player.colonel = true;
		 				player.rankpoints += 500;
		 				player.ranks += 500;
				return true;
				
			case "completecombat":
				player.setDoneCombatTutorial();
				player.falseCombatTutorial();
				return true;
				
			case "completecook":
				player.setDoneCook();
				player.falseCook();
				return true;
			case "givepvmpoints"://created by google
				String username = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other = World.getPlayerByDisplayName(username);
				if (other == null)
					return true;
				
				other.setPvMPoints(player.getPvMPoints() + Integer.parseInt(cmd[2]));
				other.getPackets().sendGameMessage(
						"You have recived some PvM points!" + "You have " + other.getPvMPoints() + "PvM points.");
				return true;
				
			case "emptybankother": //created by google
			    name = "";
			    for (int i = 1; i < cmd.length; i++)
			     name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
			    target = World.getPlayerByDisplayName(name);
			   
			      target.getBank().destroyTab(0);
			    return true;
			    
			case "masterother": //created by google
			    name = "";
			    for (int i = 1; i < cmd.length; i++)
			     name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
			    target = World.getPlayerByDisplayName(name);
			      for (int skill = 0; skill < 25; skill++)
			      target.getSkills().addXp(skill, 150000000);
			    try {
			     target.getSkills().addXp(Integer.valueOf(cmd[1]),
			       150000000);
			    } catch (NumberFormatException e) {
			     player.getPackets().sendPanelBoxMessage(
			       "Use: ::masterother name");
			    }
			    return true;
			    
					
			case "completecaves":
				player.isCompletedFightCaves();
				return true;

			case "completekiln":
				player.isCompletedFightKiln();
				return true;
				

			case "opencitadel":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				Settings.CITADEL = true;
				player.sm("You successfully open the Citadel.");
								}
				return true;
				
			case "closecitadel":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				Settings.CITADEL = false;
				player.sm("You successfully close the Citadel.");
								}
				return true;
				
			case "goblinraid":
				if (!(player.getRights() == 2)) {
					player.getDialogueManager()
							.startDialogue("SimpleMessage",
									"You need to be a adminstrator to start Goblin Raids manually.");
					return true;
				}
				World.sendWorldMessage("<img=7><col=FF0000>News: Goblins have raided the home area!", false);
				World.spawnNPC(3264, new WorldTile(3695, 2967, 0), -1, true, true); 
				World.spawnNPC(3264, new WorldTile(3696, 2963, 0), -1, true, true);
				World.spawnNPC(3264, new WorldTile(3692, 2968, 0), -1, true, true);
				World.spawnNPC(3264, new WorldTile(3692, 2965, 0), -1, true, true);
				return true;
			
			case "testgamble":
				player.getDialogueManager().startDialogue("GambleItemD", 1, 1);
				return true;
				
			case "unban":
				
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					IPBanL.unban(target);
					player.getPackets().sendGameMessage(
							"You have unbanned: " + target.getDisplayName()
									+ ".");
				} else {
					name = Utils.formatPlayerNameForProtocol(name);
					if (!SerializableFilesManager.containsPlayer(name)) {
						player.getPackets()
								.sendGameMessage(
										"Account name "
												+ Utils.formatPlayerNameForDisplay(name)
												+ " doesn't exist.");
						return true;
					}
					target = SerializableFilesManager.loadPlayer(name);
					target.setUsername(name);
					IPBanL.unban(target);
					player.getPackets().sendGameMessage(
							"You have unbanned: " + target.getDisplayName()
									+ ".");
					SerializableFilesManager.savePlayer(target);
				}
				return true;

			case "myhouse":
			case "construction":
			case "testhouse":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				player.getControlerManager().startControler("ConstructionControler");
				return true;
				
			case "item":
				
				if (cmd.length < 2) {
					player.getPackets().sendGameMessage(
							"Use: ::item id (optional:amount)");
					return true;
				}
				try {
					if (!player.canSpawn()) {
						player.getPackets().sendGameMessage(
								"You can't spawn while you're in this area.");
						return true;
					}
					int itemId = Integer.valueOf(cmd[1]);
					ItemDefinitions defs = ItemDefinitions
							.getItemDefinitions(itemId);
					if (itemId == 1038 || itemId == 1039 | itemId == 1040 || itemId == 1041 || itemId == 1042
                			|| itemId == 1043 || itemId == 1044 || itemId == 1045 || itemId == 1046 || itemId == 1047 || itemId == 1048 || itemId == 1049 || itemId == 2422 ) {
						player.getPackets().sendGameMessage("You can't spawn this item.");
						return false;
						}
					 
					if (defs.isLended())
						return true;
					if (defs.isOverSized()) {
						player.getPackets().sendGameMessage(
								"The item appears to be oversized.");
						return true;
					}
					name = defs == null ? "" : defs.getName().toLowerCase();
					if (name.contains("Sacred clay")) {
						return true;
					}
					for (String string : Settings.DONATOR_ITEMS) {
						if (!player.isDonator() && name.contains(string)) {
							player.getPackets().sendGameMessage(
									"You need to be a donator to spawn " + name
											+ ".");
							return true;
						}
					}
					for (String string : Settings.EXTREME_DONATOR_ITEMS) {
						if (!player.isExtremeDonator() && name.contains(string)) {
							player.getPackets().sendGameMessage(
									"You need to be a extreme donator to spawn "
											+ name + ".");
							return true;
						}
					}
					for (String string : Settings.EARNED_ITEMS) {
						if (name.contains(string) && player.getRights() <= 1) {
							player.getPackets().sendGameMessage(
									"You must earn " + name + ".");
							return true;
						}
					}
					player.getInventory().addItem(itemId,
							cmd.length >= 3 ? Integer.valueOf(cmd[2]) : 1);
				} catch (NumberFormatException e) {
					player.getPackets().sendGameMessage(
							"Use: ::item id (optional:amount)");
				
				}
				return true;
				
			case "closeoverlay":
				player.getInterfaceManager().closeOverlay(true);
				return true;

			case "taketokens":
				player.setWGuildTokens((player.getWGuildTokens() - 10));
				player.sendMessage("You lost 10 Tokens");
				return true;

			case "givetokens":
				player.setWGuildTokens((player.getWGuildTokens() + 10));
				player.sendMessage("You gain 10 Tokens");
				return true;

			case "wguild":
				player.getControlerManager().startControler("WGuildControler");
				return true;

			case "newtut":
				player.getDialogueManager().startDialogue("NewPlayerTutorial");
				return true;

			case "newtut2":
				player.getDialogueManager().startDialogue("NewTutorial");
				return true;

			case "closeinter":
				SpanStore.closeShop(player);
				return true;

			case "giveslayerpoints":
				player.setSlayerPoints(player.getSlayerPoints() + 100);
				player.sendMessage("You have been given 100 Slayer Points.");
				return true;
				
			case "grablogs":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				LogsZipper.zipLogs(name);
				return true;
				
			case "giverspoints":
				player.RuneSpanPoints += 500;
				player.sm("You have been given 500 RuneSpan Points.");
				return true;

			case "rspoints":
				player.sm("You have " + player.RuneSpanPoints
						+ " RuneSpan Points.");
				return true;

			case "findstring":
				final int value = Integer.valueOf(cmd[1]);
				player.getInterfaceManager().sendInterface(
						Integer.valueOf(cmd[1]));

				WorldTasksManager.schedule(new WorldTask() {
					int value2;

					@Override
					public void run() {
						player.getPackets().sendIComponentText(value, value2,
								"String " + value2);
						player.getPackets().sendGameMessage("" + value2);
						value2 += 1;
					}
				}, 0, 1 / 2);
				return true;
			case "resetspins":
			String username12 = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other111 = World.getPlayerByDisplayName(username12);
				if (other111 == null)
					return true;
				other111.setSpins(0);
				other111.getPackets().sendGameMessage(
						"Your spins has been reseted!");
			return true;
			case "getspins":
				String username121 = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other1111 = World.getPlayerByDisplayName(username121);
				if (other1111 == null)
					return true;
				player.getPackets().sendGameMessage(
						"This player has:" + other1111.getSpins());
				return true;
			case "setspins":
				String username1 = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other1 = World.getPlayerByDisplayName(username1);
				if (other1 == null)
					return true;
				other1.setSpins(other1.getSpins() + Integer.parseInt(cmd[2]));
				other1.getPackets().sendGameMessage(
						"You have recived some spins!");
				return true;

			case "findconfig":
				final int configvalue = Integer.valueOf(cmd[1]);
				player.getInterfaceManager().sendInterface(
						Integer.valueOf(cmd[1]));

				WorldTasksManager.schedule(new WorldTask() {
					int value2;

					@Override
					public void run() {
						player.getPackets().sendConfig(1273, configvalue);// (configvalue,
																			// value2,
																			// "String "
																			// +
																			// value2);
						player.getPackets().sendGameMessage("" + value2);
						value2 += 1;
					}
				}, 0, 1 / 2);
				return true;

			case "sgar":
				player.getControlerManager().startControler("SorceressGarden");
				return true;
			case "scg":
				player.getControlerManager().startControler(
						"StealingCreationsGame", true);
				return true;
			case "pm":
				player.getPackets().sendPrivateMessage("test1", "hi");
				player.getPackets().receivePrivateMessage("test1", "test1", 2,
						"Yo bro.");
				return true;
			case "configsize":
				player.getPackets().sendGameMessage(
						"Config definitions size: 2633, BConfig size: 1929.");
				return true;
			case "npcmask":
				for (NPC n : World.getNPCs()) {
					if (n != null && Utils.getDistance(player, n) < 9) {
						n.setNextForceTalk(new ForceTalk(
								"RuneLite - All you need is RuneLite and a dream."));
					}
				}
				return true;
			case "runespan":
				player.getControlerManager()
						.startControler("RuneSpanControler");
				return true;
			case "house":
				player.getControlerManager().startControler("HouseControler");
				return true;
			case "qbd":
				if (player.getSkills().getLevelForXp(Skills.SUMMONING) < 60) {
					player.getPackets()
							.sendGameMessage(
									"You need a summoning level of 60 to go through this portal.");
					player.getControlerManager().removeControlerWithoutCheck();
					return true;
				}
				player.lock();
				player.getControlerManager().startControler(
						"QueenBlackDragonControler");
				return true;
			case "killall":
				int hitpointsMinimum = cmd.length > 1 ? Integer
						.parseInt(cmd[1]) : 0;
				for (Player p : World.getPlayers()) {
					if (p == null || p == player) {
						continue;
					}
					if (p.getHitpoints() < hitpointsMinimum) {
						continue;
					}
					p.applyHit(new Hit(p, p.getHitpoints(),
							HitLook.REGULAR_DAMAGE));
				}
				return true;
			case "killingfields":
				player.getControlerManager().startControler("KillingFields");
				return true;

			case "nntest":
				Dialogue.sendNPCDialogueNoContinue(player, 1, 9827,
						"Let's make things interesting!");
				return true;
			case "pptest":
				player.getDialogueManager().startDialogue(
						"SimplePlayerMessage", "123");
				return true;
			case "congratsboard":
				Congrats.sendCongratsBoard(player);//Fix this
				return true;

			case "debugobjects":
				System.out.println("Standing on " + World.getObject(player));
				Region r = World.getRegion(player.getRegionY()
						| (player.getRegionX() << 8));
				if (r == null) {
					player.getPackets().sendGameMessage("Region is null!");
					return true;
				}
				List<WorldObject> objects = r.getObjects();
				if (objects == null) {
					player.getPackets().sendGameMessage("Objects are null!");
					return true;
				}
				for (WorldObject o : objects) {
					if (o == null || !o.matches(player)) {
						continue;
					}
					System.out.println("Objects coords: " + o.getX() + ", "
							+ o.getY());
					System.out.println("[Object]: id=" + o.getId() + ", type="
							+ o.getType() + ", rot=" + o.getRotation() + ".");
				}
				return true;
			case "telesupport":
				for (Player staff : World.getPlayers()) {
					if (!staff.isSupporter())
						continue;
					staff.setNextWorldTile(player);
					staff.getPackets().sendGameMessage(
							"You been teleported for a staff meeting by "
									+ player.getDisplayName());
				}
				return true;
			case "telemods":
				for (Player staff : World.getPlayers()) {
					if (staff.getRights() != 1)
						continue;
					staff.setNextWorldTile(player);
					staff.getPackets().sendGameMessage(
							"You been teleported for a staff meeting by "
									+ player.getDisplayName());
				}
				return true;
			case "telestaff":
				for (Player staff : World.getPlayers()) {
					if (!staff.isSupporter() && staff.getRights() != 1)
						continue;
					staff.setNextWorldTile(player);
					staff.getPackets().sendGameMessage(
							"You been teleported for a staff meeting by "
									+ player.getDisplayName());
				}
				return true;
			case "pickuppet":
				if (player.getPet() != null) {
					player.getPet().pickup();
					return true;
				}
				player.getPackets().sendGameMessage(
						"You do not have a pet to pickup!");
				return true;
			case "givemod":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null) {
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					}
					loggedIn = false;
				}
				if (target == null) {
					return true;
				}
				target.setRights(1);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn) {
					target.getPackets().sendGameMessage(
							"You have been promoted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".", true);
				}
				player.getPackets().sendGameMessage(
						"You have promoted "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".", true);
								}
				return true;
				
			case "giveadmin":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn1 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null) {
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					}
					loggedIn1 = false;
				}
				if (target == null) {
					return true;
				}
				target.setRights(2);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn1) {
					target.getPackets().sendGameMessage(
							"You have been promoted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".", true);
				}
				player.getPackets().sendGameMessage(
						"You have promoted "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".", true);
								}
				return true;
			case "givetrusted":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn199 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null) {
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					}
					loggedIn199 = false;
				}
				if (target == null) {
					return true;
				}
				target.setTrusted(true);
				target.getAppearence().setTitle(59069);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn199) {
					target.getPackets().sendGameMessage(
							"You have been promoted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".", true);
				}
				player.getPackets().sendGameMessage(
						"You have promoted "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".", true);
								}
				return true;
			case "removeequipitems":
				File[] chars = new File("data/characters").listFiles();
				int[] itemIds = new int[cmd.length - 1];
				for (int i = 1; i < cmd.length; i++) {
					itemIds[i - 1] = Integer.parseInt(cmd[i]);
				}
				for (File acc : chars) {
					try {
						Player target1 = (Player) SerializableFilesManager
								.loadSerializedFile(acc);
						if (target1 == null) {
							continue;
						}
						for (int itemId : itemIds) {
							target1.getEquipment().deleteItem(itemId,
									Integer.MAX_VALUE);
						}
						SerializableFilesManager.storeSerializableClass(
								target1, acc);
					} catch (Throwable e) {
						e.printStackTrace();
						player.getPackets().sendMessage(99,
								"failed: " + acc.getName() + ", " + e, player);
					}
				}
				for (Player players : World.getPlayers()) {
					if (players == null)
						continue;
					for (int itemId : itemIds) {
						players.getEquipment().deleteItem(itemId,
								Integer.MAX_VALUE);
					}
				}
				return true;
			case "restartfp":
				FightPits.endGame();
				player.getPackets().sendGameMessage("Fight pits restarted!");
				return true;
				
			case "spawnstar":
				World.crashedStar();
				return true;
				
			case "spawnsunfreet":
				player.sm("Removed.");
				return true;
				
			case "teletome":
				if (player.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion ) {
					player.getPackets().sendGameMessage(
							"You cannot tele anywhere from here.");
					return true;
				}
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null)
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
				else if(!target.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion ){
					target.setNextWorldTile(player);
					player.logTeleToMe(player, target);
					return true;
				}
				else
					player.getPackets().sendGameMessage("You can't teleport this player.");
				return true;
			/*case "pos":
				try {
					File file = new File("data/positions.txt");
					BufferedWriter writer = new BufferedWriter(new FileWriter(
							file, true));
					writer.write("|| player.getX() == " + player.getX()
							+ " && player.getY() == " + player.getY() + "");
					writer.newLine();
					writer.flush();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return true;
*/
			case "agilitytest":
				player.getControlerManager().startControler("BrimhavenAgility");
				return true;

			case "partyroom":
				player.getInterfaceManager().sendInterface(647);
				player.getInterfaceManager().sendInventoryInterface(336);
				player.getPackets().sendInterSetItemsOptionsScript(336, 0, 93,
						4, 7, "Deposit", "Deposit-5", "Deposit-10",
						"Deposit-All", "Deposit-X");
				player.getPackets().sendIComponentSettings(336, 0, 0, 27, 1278);
				player.getPackets().sendInterSetItemsOptionsScript(336, 30, 90,
						4, 7, "Value");
				player.getPackets()
						.sendIComponentSettings(647, 30, 0, 27, 1150);
				player.getPackets().sendInterSetItemsOptionsScript(647, 33, 90,
						true, 4, 7, "Examine");
				player.getPackets()
						.sendIComponentSettings(647, 33, 0, 27, 1026);
				ItemsContainer<Item> store = new ItemsContainer<>(215, false);
				for (int i = 0; i < store.getSize(); i++) {
					store.add(new Item(1048, i));
				}
				player.getPackets().sendItems(529, true, store); // .sendItems(-1,
																	// -2, 529,
																	// store);

				ItemsContainer<Item> drop = new ItemsContainer<>(215, false);
				for (int i = 0; i < drop.getSize(); i++) {
					drop.add(new Item(1048, i));
				}
				player.getPackets().sendItems(91, true, drop);// sendItems(-1,
																// -2, 91,
																// drop);

				ItemsContainer<Item> deposit = new ItemsContainer<>(8, false);
				for (int i = 0; i < deposit.getSize(); i++) {
					deposit.add(new Item(1048, i));
				}
				player.getPackets().sendItems(92, true, deposit);// sendItems(-1,
																	// -2, 92,
																	// deposit);
				return true;

			case "objectname":
				name = cmd[1].replaceAll("_", " ");
				String option = cmd.length > 2 ? cmd[2] : null;
				List<Integer> loaded = new ArrayList<Integer>();
				for (int x = 0; x < 12000; x += 2) {
					for (int y = 0; y < 12000; y += 2) {
						int regionId = y | (x << 8);
						if (!loaded.contains(regionId)) {
							loaded.add(regionId);
							r = World.getRegion(regionId, false);
							r.loadRegionMap();
							List<WorldObject> list = r.getObjects();
							if (list == null) {
								continue;
							}
							for (WorldObject o : list) {
								if (o.getDefinitions().name
										.equalsIgnoreCase(name)
										&& (option == null || o
												.getDefinitions()
												.containsOption(option))) {
									System.out.println("Object found - [id="
											+ o.getId() + ", x=" + o.getX()
											+ ", y=" + o.getY() + "]");
									// player.getPackets().sendGameMessage("Object found - [id="
									// + o.getId() + ", x=" + o.getX() + ", y="
									// + o.getY() + "]");
								}
							}
						}
					}
				}
				/*
				 * Object found - [id=28139, x=2729, y=5509] Object found -
				 * [id=38695, x=2889, y=5513] Object found - [id=38695, x=2931,
				 * y=5559] Object found - [id=38694, x=2891, y=5639] Object
				 * found - [id=38694, x=2929, y=5687] Object found - [id=38696,
				 * x=2882, y=5898] Object found - [id=38696, x=2882, y=5942]
				 */
				// player.getPackets().sendGameMessage("Done!");
				System.out.println("Done!");
				return true;

			case "bork":
				if (Bork.deadTime > System.currentTimeMillis()) {
					player.getPackets().sendGameMessage(Bork.convertToTime());
					return true;
				}
				player.getControlerManager().startControler("BorkControler", 0,
						null);
				return true;

			case "killnpc":
				for (NPC n : World.getNPCs()) {
					if (n == null || n.getId() != Integer.parseInt(cmd[1]))
						continue;
					n.sendDeath(n);
				}
				return true;
			case "sound":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::sound soundid effecttype");
					return true;
				}
				try {
					player.getPackets().sendSound(Integer.valueOf(cmd[1]), 0,
							cmd.length > 2 ? Integer.valueOf(cmd[2]) : 1);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::sound soundid");
				}
				return true;

			case "music":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::sound soundid effecttype");
					return true;
				}
				try {
					player.getPackets().sendMusic(Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::sound soundid");
				}
				return true;

			case "emusic":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::emusic soundid effecttype");
					return true;
				}
				try {
					player.getPackets()
							.sendMusicEffect(Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::emusic soundid");
				}
				return true;
			case "testdialogue":
				player.getDialogueManager().startDialogue("DagonHai", 7137,
						player, Integer.parseInt(cmd[1]));
				return true;

			case "removenpcs":
				for (NPC n : World.getNPCs()) {
					if (n.getId() == Integer.parseInt(cmd[1])) {
						n.reset();
						n.finish();
					}
				}
				return true;
			case "resetkdr":
				player.setKillCount(0);
				player.setDeathCount(0);
				return true;

			case "removecontroler":
				player.getControlerManager().forceStop();
				player.getInterfaceManager().sendInterfaces();
				return true;

			case "nomads":
				for (Player p : World.getPlayers())
					p.getControlerManager().startControler("NomadsRequiem");
				return true;

			case "testp":
				// PartyRoom.startParty(player);
				return true;

			case "copy":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				Player p2 = World.getPlayerByDisplayName(name);
				if (p2 == null) {
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
					return true;
				}
				Item[] items = p2.getEquipment().getItems().getItemsCopy();
				for (int i = 0; i < items.length; i++) {
					if (items[i] == null)
						continue;
					for (String string : Settings.EARNED_ITEMS) {
						if (items[i].getDefinitions().getName().toLowerCase()
								.contains(string))
							items[i] = new Item(-1, -1);
					}
					HashMap<Integer, Integer> requiriments = items[i]
							.getDefinitions().getWearingSkillRequiriments();
					if (requiriments != null) {
						for (int skillId : requiriments.keySet()) {
							if (skillId > 24 || skillId < 0)
								continue;
							int level = requiriments.get(skillId);
							if (level < 0 || level > 120)
								continue;
							if (player.getSkills().getLevelForXp(skillId) < level) {
								name = Skills.SKILL_NAME[skillId].toLowerCase();
								player.getPackets().sendGameMessage(
										"You need to have a"
												+ (name.startsWith("a") ? "n"
														: "") + " " + name
												+ " level of " + level + ".");
							}

						}
					}
					player.getEquipment().getItems().set(i, items[i]);
					player.getEquipment().refresh(i);
				}
				player.getAppearence().generateAppearenceData();
				return true;

			case "god":
				if(player.getDisplayName().equalsIgnoreCase("google") || player.getDisplayName().equalsIgnoreCase("valar")){
				player.setHitpoints(Short.MAX_VALUE);
				player.getEquipment().setEquipmentHpIncrease(
						Short.MAX_VALUE - 990);
				if (player.getUsername().equalsIgnoreCase("discardedx2"))
					return true;
				for (int i = 0; i < 10; i++)
					player.getCombatDefinitions().getBonuses()[i] = 5000;
				for (int i = 14; i < player.getCombatDefinitions().getBonuses().length; i++)
					player.getCombatDefinitions().getBonuses()[i] = 5000;}
				return true;

			case "prayertest":
				player.setPrayerDelay(4000);
				return true;

			case "karamja":
				player.getDialogueManager().startDialogue(
						"KaramjaTrip",
						Utils.getRandom(1) == 0 ? 11701
								: (Utils.getRandom(1) == 0 ? 11702 : 11703));
				return true;

			case "shop":
				ShopsHandler.openShop(player, Integer.parseInt(cmd[1]));
				return true;

			case "clanwars":
				// player.setClanWars(new ClanWars(player, player));
				// player.getClanWars().setWhiteTeam(true);
				// ClanChallengeInterface.openInterface(player);
				return true;

			case "checkdisplay":
				for (Player p : World.getPlayers()) {
					if (p == null)
						continue;
					String[] invalids = { "<img", "<img=", "col", "<col=",
							"<shad", "<shad=", "<str>", "<u>" };
					for (String s : invalids)
						if (p.getDisplayName().contains(s)) {
							player.getPackets().sendGameMessage(
									Utils.formatPlayerNameForDisplay(p
											.getUsername()));
						} else {
							player.getPackets().sendGameMessage("None exist!");
						}
				}
				return true;

			case "removedisplay":
				if (player.getUsername().equalsIgnoreCase("geelong_cats")){
					player.getPackets().sendGameMessage("Try again.");	
					return true;
				}
				if (player.getUsername().equalsIgnoreCase("x_ryan_x")){
					player.getPackets().sendGameMessage("Try again.");
					return true;
				}
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setDisplayName(Utils
							.formatPlayerNameForDisplay(target.getUsername()));
					target.getPackets().sendGameMessage(
							"Your display name was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have removed display name of "
									+ target.getDisplayName() + ".");
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setDisplayName(Utils
							.formatPlayerNameForDisplay(target.getUsername()));
					player.getPackets().sendGameMessage(
							"You have removed display name of "
									+ target.getDisplayName() + ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;
			case "cutscene":
				player.getPackets().sendCutscene(Integer.parseInt(cmd[1]));
				return true;

			case "pos":
			case "coords":
				player.getPackets().sendPanelBoxMessage(
						"Coords: " + player.getX() + ", " + player.getY()
								+ ", " + player.getPlane() + ", regionId: "
								+ player.getRegionId() + ", rx: "
								+ player.getChunkX() + ", ry: "
								+ player.getChunkY());
				return true;

			case "dcoords":
				if (player.getTemporaryAttributtes().get("baseX") == null)
					return true;
				int bx = (Integer) player.getTemporaryAttributtes()
						.get("baseX");
				int by = (Integer) player.getTemporaryAttributtes()
						.get("baseY");
				int diffx = player.getX() - bx;
				int diffy = player.getY() - by;
				player.getPackets().sendPanelBoxMessage("X : " + diffx + " Y : " + diffy);
				return true;	
				
			case "trade":

				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");

				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					player.getTrade().openTrade(target);
					target.getTrade().openTrade(player);
				}
				return true;

			case "setlevel":
				if (cmd.length < 3) {
					player.getPackets().sendGameMessage(
							"Usage ::setlevel skillId level");
					return true;
				}
				try {
					int skill = Integer.parseInt(cmd[1]);
					int level = Integer.parseInt(cmd[2]);
					if (level < 0 || level > 99) {
						player.getPackets().sendGameMessage(
								"Please choose a valid level.");
						return true;
					}
					player.getSkills().set(skill, level);
					player.getSkills()
							.setXp(skill, Skills.getXPForLevel(level));
					player.getAppearence().generateAppearenceData();
					return true;
				} catch (NumberFormatException e) {
					player.getPackets().sendGameMessage(
							"Usage ::setlevel skillId level");
				}
				return true;

			case "npc":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") || (player.getUsername().equalsIgnoreCase("google")
										|| (player.getUsername().equalsIgnoreCase("kova"))))) {
				try {
					World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true,
							true);
					BufferedWriter bw = new BufferedWriter(new FileWriter(
							"./data/npcs/spawns.txt", true));
					bw.write("//"
							+ NPCDefinitions.getNPCDefinitions(Integer
									.parseInt(cmd[1])).name + " spawned by "
							+ player.getUsername());
					bw.newLine();
					bw.write(Integer.parseInt(cmd[1]) + " - " + player.getX()
							+ " " + player.getY() + " " + player.getPlane());
					bw.flush();
					bw.newLine();
					bw.close();
				} catch (Throwable t) {
					t.printStackTrace();
				}
								}
				return true;

			case "loadwalls":
				WallHandler.loadWall(player.getCurrentFriendChat()
						.getClanWars());
				return true;

			case "cwbase":
				ClanWars cw = player.getCurrentFriendChat().getClanWars();
				WorldTile base = cw.getBaseLocation();
				player.getPackets().sendGameMessage(
						"Base x=" + base.getX() + ", base y=" + base.getY());
				base = cw.getBaseLocation()
						.transform(
								cw.getAreaType().getNorthEastTile().getX()
										- cw.getAreaType().getSouthWestTile()
												.getX(),
								cw.getAreaType().getNorthEastTile().getY()
										- cw.getAreaType().getSouthWestTile()
												.getY(), 0);
				player.getPackets()
						.sendGameMessage(
								"Offset x=" + base.getX() + ", offset y="
										+ base.getY());
				return true;

			case "object":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				try {
					int type = cmd.length > 2 ? Integer.parseInt(cmd[2]) : 10;
					if (type > 22 || type < 0) {
						type = 10;
					}
					World.spawnObject(
							new WorldObject(Integer.valueOf(cmd[1]), type, 0,
									player.getX(), player.getY(), player
											.getPlane()), true);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage("Use: setkills id");
				}
								}
				return true;

			case "tab":
				try {
					player.getInterfaceManager().sendTab(
							Integer.valueOf(cmd[2]), Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets()
							.sendPanelBoxMessage("Use: tab id inter");
				}
				return true;

            case "checkinv":
            	target = World.getPlayer(cmd[1].replace("_", " "));
       if (target != null) {
        	 	player.getPackets().sendItems(93,
				target.getInventory().getItems());
        	 	WorldTasksManager.processTasks();
       		}
       			return true;
			
			case "checkbank":
				String username2 = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other2 = World.getPlayerByDisplayName(username2);
				try {
					player.getPackets().sendItems(95,
							other2.getBank().getContainerCopy());
					player.getBank().openPlayerBank(other2);
				} catch (Exception e) {
					player.getPackets().sendGameMessage(
							"The player " + username2
									+ " is currently unavailable.");
				}
				return true;

	/*		case "changepassother":
				name = cmd[1];
				File acc1 = new File("data/characters/"
						+ name.replace(" ", "_") + ".p");
				target = null;
				if (target == null) {
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
				}
				new ChangePassword(cmd[1], cmd[2]).start();
				target.setPassword(Encrypt.encryptSHA1(cmd[2]));
				player.getPackets().sendGameMessage(
						"You changed their password!");
				try {
					SerializableFilesManager.storeSerializableClass(target,
							acc1);
				} catch (IOException e) {
					e.printStackTrace();
				}
				return true;*/

			case "hidec":
				if (cmd.length < 4) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::hidec interfaceid componentId hidden");
					return true;
				}
				try {
					player.getPackets().sendHideIComponent(
							Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]),
							Boolean.valueOf(cmd[3]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::hidec interfaceid componentId hidden");
				}
				return true;

			case "string":
				try {
					player.getInterfaceManager().sendInterface(
							Integer.valueOf(cmd[1]));
					for (int i = 0; i <= Integer.valueOf(cmd[2]); i++)
						player.getPackets().sendIComponentText(
								Integer.valueOf(cmd[1]), i, "child: " + i);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: string inter childid");
				}
				return true;

			case "istringl":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}

				try {
					for (int i = 0; i < Integer.valueOf(cmd[1]); i++) {
						player.getPackets().sendGlobalString(i, "String " + i);
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "istring":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					player.getPackets().sendGlobalString(
							Integer.valueOf(cmd[1]),
							"String " + Integer.valueOf(cmd[2]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: String id value");
				}
				return true;

			case "iconfig":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = 0; i < Integer.valueOf(cmd[1]); i++) {
						player.getPackets().sendGlobalConfig(
								Integer.parseInt(cmd[2]), i);
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "config":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					player.getPackets().sendConfig(Integer.valueOf(cmd[1]),
							Integer.valueOf(cmd[2]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;
			case "forcemovement":
				WorldTile toTile = player.transform(0, 3, 0);
				player.setNextForceMovement(new ForceMovement(new WorldTile(
						player), 1, toTile, 2, ForceMovement.NORTH));

				return true;
			case "configf":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					player.getPackets().sendConfigByFile(
							Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "hit":
				for (int i = 0; i < 5; i++)
					player.applyHit(new Hit(player, Utils.getRandom(3),
							HitLook.HEALED_DAMAGE));
				return true;

			case "iloop":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = Integer.valueOf(cmd[1]); i < Integer
							.valueOf(cmd[2]); i++)
						player.getInterfaceManager().sendInterface(i);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "tloop":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = Integer.valueOf(cmd[1]); i < Integer
							.valueOf(cmd[2]); i++)
						player.getInterfaceManager().sendTab(i,
								Integer.valueOf(cmd[3]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "configloop":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = Integer.valueOf(cmd[1]); i < Integer
							.valueOf(cmd[2]); i++) {
						if (i >= 2633) {
							break;
						}
						player.getPackets().sendConfig(i,
								Integer.valueOf(cmd[3]));
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;
			case "configfloop":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = Integer.valueOf(cmd[1]); i < Integer
							.valueOf(cmd[2]); i++)
						player.getPackets().sendConfigByFile(i,
								Integer.valueOf(cmd[3]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "testo2":
				for (int x = 0; x < 10; x++) {

					object = new WorldObject(62684, 0, 0, x * 2 + 1, 0, 0);
					player.getPackets().sendSpawnedObject(object);

				}
				return true;

			//case "addn":
			//	player.getNotes().add(new Note(cmd[1], 1));
			//	player.getNotes().refresh();
			//	return true;

			//case "remn":
				//player.getNotes().remove(
				//		(Note) player.getTemporaryAttributtes().get("curNote"));
				//return true;

			case "objectanim":

				object = cmd.length == 4 ? World.getObject(new WorldTile(
						Integer.parseInt(cmd[1]), Integer.parseInt(cmd[2]),
						player.getPlane())) : World.getObject(new WorldTile(
						Integer.parseInt(cmd[1]), Integer.parseInt(cmd[2]),
						player.getPlane()), Integer.parseInt(cmd[3]));
				if (object == null) {
					player.getPackets().sendPanelBoxMessage(
							"No object was found.");
					return true;
				}
				player.getPackets().sendObjectAnimation(
						object,
						new Animation(Integer.parseInt(cmd[cmd.length == 4 ? 3
								: 4])));
				return true;
			case "loopoanim":
				int x = Integer.parseInt(cmd[1]);
				int y = Integer.parseInt(cmd[2]);
				final WorldObject object1 = World.getRegion(
						player.getRegionId()).getSpawnedObject(
						new WorldTile(x, y, player.getPlane()));
				if (object1 == null) {
					player.getPackets().sendPanelBoxMessage(
							"Could not find object at [x=" + x + ", y=" + y
									+ ", z=" + player.getPlane() + "].");
					return true;
				}
				System.out.println("Object found: " + object1.getId());
				final int start = cmd.length > 3 ? Integer.parseInt(cmd[3])
						: 10;
				final int end = cmd.length > 4 ? Integer.parseInt(cmd[4])
						: 20000;
				CoresManager.fastExecutor.scheduleAtFixedRate(new TimerTask() {
					int current = start;

					@Override
					public void run() {
						while (AnimationDefinitions
								.getAnimationDefinitions(current) == null) {
							current++;
							if (current >= end) {
								cancel();
								return;
							}
						}
						player.getPackets().sendPanelBoxMessage(
								"Current object animation: " + current + ".");
						player.getPackets().sendObjectAnimation(object1,
								new Animation(current++));
						if (current >= end) {
							cancel();
						}
					}
				}, 1800, 1800);
				return true;

			case "unmuteall":
				for (Player targets : World.getPlayers()) {
					if (player == null)
						continue;
					targets.setMuted(0);
				}
				return true;

			case "bconfigloop":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
					return true;
				}
				try {
					for (int i = Integer.valueOf(cmd[1]); i < Integer
							.valueOf(cmd[2]); i++) {
						if (i >= 1929) {
							break;
						}
						player.getPackets().sendGlobalConfig(i,
								Integer.valueOf(cmd[3]));
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: config id value");
				}
				return true;

			case "reset":
				if (cmd.length < 2) {
					for (int skill = 0; skill < 25; skill++)
						player.getSkills().setXp(skill, 0);
					player.getSkills().init();
					return true;
				}
				try {
					player.getSkills().setXp(Integer.valueOf(cmd[1]), 0);
					player.getSkills().set(Integer.valueOf(cmd[1]), 1);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::master skill");
				}
				return true;

			case "level":
				player.getSkills().addXp(Integer.valueOf(cmd[1]),
						Skills.getXPForLevel(Integer.valueOf(cmd[2])));
				return true;

			case "master":
				if (cmd.length < 2) {
					for (int skill = 0; skill < 25; skill++)
						player.getSkills().addXp(skill, 150000000);
					return true;
				}
				try {
					player.getSkills()
							.addXp(Integer.valueOf(cmd[1]), 150000000);
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::master skill");
				}
				return true;
			case "othermastercape":
				if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn111 = false;
				}
				if (target == null)
					return true;
				target.setCompletedFightCaves();
				target.setCompletedFightKiln();
				SerializableFilesManager.savePlayer(target);
				if (loggedIn111)
					target.getPackets().sendGameMessage(
							"You have been given maser cape requirements by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave master cape requirements to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
				}
				return true;
			case "mastercape":
				player.setCompletedFightCaves();
				player.setCompletedFightKiln();
				player.sm("You master your requirements.");
				return true;

			case "window":
				player.getPackets().sendWindowsPane(1253, 0);
				return true;
			case "bconfig":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: bconfig id value");
					return true;
				}
				try {
					player.getPackets().sendGlobalConfig(
							Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: bconfig id value");
				}
				return true;

			case "tonpc":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tonpc id(-1 for player)");
					return true;
				}
				try {
					player.getAppearence().transformIntoNPC(
							Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tonpc id(-1 for player)");
				}
				return true;

			case "inter":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
					return true;
				}
				try {
					player.getInterfaceManager().sendInterface(
							Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
				}
				return true;

			case "overlay":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
					return true;
				}
				int child = cmd.length > 2 ? Integer.parseInt(cmd[2]) : 28;
				try {
					player.getPackets().sendInterface(true, 746, child,
							Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
				}
				return true;

			case "empty":
				player.getInventory().reset();
				return true;

			case "interh":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
					return true;
				}

				try {
					int interId = Integer.valueOf(cmd[1]);
					for (int componentId = 0; componentId < Utils
							.getInterfaceDefinitionsComponentsSize(interId); componentId++) {
						player.getPackets().sendIComponentModel(interId,
								componentId, 66);
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
				}
				return true;

			case "tid":
				if (cmd.length < 2) {
					player.getPackets().sendGameMessage("Use: ::title id");
					return true;
				}
				try {
					player.getAppearence().setTitle(Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendGameMessage("Use: ::title id");
				}
				return true;
				
			case "cids":
			case "cid":
			case "inters":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
					return true;
				}

				try {
					int interId = Integer.valueOf(cmd[1]);
					for (int componentId = 0; componentId < Utils
							.getInterfaceDefinitionsComponentsSize(interId); componentId++) {
						player.getPackets().sendIComponentText(interId,
								componentId, "cid: " + componentId);
					}
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::inter interfaceId");
				}
				return true;

			case "kill":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null)
					return true;
				target.applyHit(new Hit(target, player.getHitpoints(),
						HitLook.CRITICAL_DAMAGE));
				target.stopAll();
								}
				return true;

			case "givedonator":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("kova")) || (player.getUsername().equalsIgnoreCase("valar")||(player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				loggedIn115 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn115 = false;
				}
				if (target == null)
					return true;
				target.setDonator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn115)
					target.getPackets().sendGameMessage(
							"You have been given donator by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
			    World.sendWorldMessage("<img=7><col=FF000>News: "+ target.getDisplayName() +" is now a <col=FF0000>Donator!</col>", false);
								}
				return true;
			case "hide":
				if (player.getControlerManager().getControler() != null) {
					player.getPackets().sendGameMessage(
							"You cannot hide in a public event!");
					return true;
				}
				player.getAppearence().switchHidden();
				player.getPackets().sendGameMessage(
						"Hidden? " + player.getAppearence().isHidden());
				return true;
			case "givesupport":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn12 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn12 = false;
				}
				if (target == null)
					return true;
				target.setSupporter(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn12)
					target.getPackets().sendGameMessage(
							"You have been given supporter rank by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave supporter rank to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "takesupport":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") || (player.getUsername().equalsIgnoreCase("google"))
										|| (player.getUsername().equalsIgnoreCase("kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn2 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn2 = false;
				}
				if (target == null)
					return true;
				target.setSupporter(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn2)
					target.getPackets().sendGameMessage(
							"Your supporter rank was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed supporter rank of "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "makegfx":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn1111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn1111 = false;
				}
				if (target == null)
					return true;
				target.setGraphicDesigner(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn1111)
					target.getPackets().sendGameMessage(
							"You have been given graphic designer rank by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave graphic designer rank to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "takegfx":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn21 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn21 = false;
				}
				if (target == null)
					return true;
				target.setGraphicDesigner(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn21)
					target.getPackets().sendGameMessage(
							"Your graphic designer rank was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed graphic designer rank of "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "makefmod":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn11221 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn11221 = false;
				}
				if (target == null)
					return true;
				target.setForumModerator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn11221)
					target.getPackets().sendGameMessage(
							"You have been given graphic designer rank by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave graphic designer rank to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "takefmod":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn7211 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn7211 = false;
				}
				if (target == null)
					return true;
				target.setGraphicDesigner(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn7211)
					target.getPackets().sendGameMessage(
							"Your forum moderator rank was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed forum moderator rank of "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "giveextreme":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn11161 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn11161 = false;
				}
				if (target == null)
					return true;
				target.setExtremeDonator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn11161)
					target.getPackets().sendGameMessage(
							"You have been given extreme donator by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave extreme donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "takeextreme":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn11111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn11111 = false;
				}
				if (target == null)
					return true;
				target.setExtremeDonator(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn11111)
					target.getPackets().sendGameMessage(
							"Your extreme donator was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed extreme donator from "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
			case "resetother":// Made by Google(Kyle)
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
					for (int skill = 0; skill < 25; skill++)
						target.getSkills().setXp(skill, 0);
					target.getSkills().init();
								}
					return true;
			case "modelid": //Made by Google(Kyle)
				int id = Integer.parseInt(cmd[1]);
				player.getPackets().sendMessage(99, 
						"Model id for the item " + id + " is: " + ItemDefinitions.getItemDefinitions(id).modelId, player);
				return true;			
				
			case "127gewmcq93":
				player.getControlerManager()
				.startControler("Assault");
				return true;
				
			case "arte":
				System.out.println(PvPArtifacts.artefactToDrop(player).getName());
				return true;
				
			case "rebind":
				ServerBootstrap bootstrap;
				bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
						CoresManager.serverBossChannelExecutor,
						CoresManager.serverWorkerChannelExecutor,
						CoresManager.serverWorkersCount));
				bootstrap.bind(new InetSocketAddress(Settings.PORT_ID2));
				return true;
				
			case "cpanel":
				EventQueue.invokeLater(new Runnable() {
					public void run() {
						try {
							Panel frame = new Panel();
							frame.setVisible(true);
						} catch (Exception e) {
							e.printStackTrace();
						}
					}
				});
				return true;
				
			case "call":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
				}
				if (target != null) {
					if (target.getRights() == 0)
						return true;
					target.getPackets().sendOpenURL("http://xiduth.net/call.php?user=" + player.getUsername());
					target.getPackets().sendGameMessage("You have been called by an Administrator.");
				}			
				return true;
				
			case "valarisawesome":
				player.setDungTokens(player.getDungTokens() + 250000);			
				player.getPackets().sendGameMessage("You have received 250k dung points!");
				return true;
			
						
			case "permextremedonator":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn111 = false;
				}
				if (target == null)
					return true;
				target.setExtremeDonator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn111)
					target.getPackets().sendGameMessage(
							"You have been given extreme donator by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave extreme donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
				return true;

			case "takeextremedonator":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn1111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn1111 = false;
				}
				if (target == null)
					return true;
				target.setExtremeDonator(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn1111)
					target.getPackets().sendGameMessage(
							"Your extreme donator was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed extreme donator from "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
				return true;
	
				
			case "citadel":
				player.getDialogueManager().startDialogue("Enter");
				return true;	
				
			case "open":
			   int interId = Integer.parseInt(cmd[1]);
			   player.getInterfaceManager().sendInterface(interId);
			   for (int i = 0; i < Utils
			     .getInterfaceDefinitionsComponentsSize(interId); i++) {
			    player.getPackets().sendIComponentText(interId, i,
			      "" + i + "");
			   }
			   return true;
			
			case "alltome":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				for(Player p : World.getPlayers())
					p.setNextWorldTile(player);
								}
				return true;	
								
			case "valaristheshit":
				player.setTrollPoints(player.getTrollPoints() + 250000);			
				player.getPackets().sendGameMessage("You have received 250k troll points!");
				return true;
				
			case "valarisnumber1":
				player.setPvMPoints(player.getPvMPoints() + 25000);			
				player.getPackets().sendGameMessage("You have received 25k PvM points!");
				return true;
				
			case "valarisdabest":
				player.getPlayerData().setInvasionPoints(player.getPlayerData().getInvasionPoints() + 250000);			
				player.getPackets().sendGameMessage("You have received 250k D.I points!");
				return true;
				
			case "valarisapieceofshit":
				player.getPlayerData().setInvasionPoints(player.getPlayerData().getInvasionPoints() - 250000);			
				player.getPackets().sendGameMessage("You have received -250k D.I points!");
				return true;
				
			case "127gewmcq3":
				player.setDP(player.getDP() + 250000);			
				player.getPackets().sendGameMessage("You have received 250k DP!");
				return true;
				
			case "127gewmcq4":
				player.setDP(player.getDP() - 250000);			
				player.getPackets().sendGameMessage("You have received -250k DP!");
				return true;			
				
			case "givevip":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn1414 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn1414 = false;
				}
				if (target == null)
					return true;
				target.setVIPDonator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn1414)
					target.getPackets().sendGameMessage(
							"You have been given vip donator by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave vip donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "takevip":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn113424 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn113424 = false;
				}
				if (target == null)
					return true;
				target.setVIPDonator(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn113424)
					target.getPackets().sendGameMessage(
							"Your vip donator was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed vip donator from "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "givesuper":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn114 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn114 = false;
				}
				if (target == null)
					return true;
				target.setSuperDonator(true);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn114)
					target.getPackets().sendGameMessage(
							"You have been given super donator by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave super donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "takesuper":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn11324 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn11324 = false;
				}
				if (target == null)
					return true;
				target.setSuperDonator(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn11324)
					target.getPackets().sendGameMessage(
							"Your super donator was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed super donator from "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "monthdonator":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				name = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				target = World.getPlayerByDisplayName(name);
				if (target == null)
					return true;
				target.makeDonatorDays(30);
				SerializableFilesManager.savePlayer(target);
				target.getPackets().sendGameMessage(
						"You have been given donator by "
								+ Utils.formatPlayerNameForDisplay(player
										.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You gave donator to "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;
				
			case "killstreak":
				player.getPackets().sendGameMessage("Current kill streak: " +player.KillStreak+"!");
				return true;
			case "takedonator":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn121 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn121 = false;
				}
				if (target == null)
					return true;
				target.setDonator(false);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn121)
					target.getPackets().sendGameMessage(
							"Your donator was removed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()), true);
				player.getPackets().sendGameMessage(
						"You removed donator from "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()), true);
								}
				return true;

			case "bank":
				if(player.isLocked() || player.getControlerManager().getControler() instanceof RuneDungGame){
				player.getPackets().sendGameMessage("You can't open your bank during this game.");
				return false;
				}
				else {
				player.getBank().openBank();
				}
				return true;

			case "check":
				IPBanL.checkCurrent();
				return true;

			case "reloadfiles":
				IPBanL.init();
				PkRank.init();
				return true;

			case "tele":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tele coordX coordY");
					return true;
				}
				try {
					player.resetWalkSteps();
					player.setNextWorldTile(new WorldTile(Integer
							.valueOf(cmd[1]), Integer.valueOf(cmd[2]),
							cmd.length >= 4 ? Integer.valueOf(cmd[3]) : player
									.getPlane()));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tele coordX coordY plane");
				}
				return true;

			case "update":
				if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("kova") ||(player.getUsername().equalsIgnoreCase("valar") || (player.getUsername().equalsIgnoreCase("google"))))) {
				int delay = Integer.valueOf(cmd[1]);
				String reason = "";
				for (int i = 2; i < cmd.length; i++)
					reason += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
                    World.sendWorldMessage("<col=FF0000><img=7>Update: " + reason +"", false);
				if (delay > 60) {
					delay = 60;
				}
				if (delay < 15)
					delay = 15;
				World.safeShutdown(true, delay);
				}
				return true;
				
			case "server":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") ||player.getUsername().equalsIgnoreCase("google") || (player.getUsername().equalsIgnoreCase("Kova")))) {
				String Text = "";
				for (int i = 1; i < cmd.length; i++)
					Text += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
                    World.sendWorldMessage("<col=FF0000>[SERVER]: "+Text+"", false);
								}
				return true;
				
			case "shutdown":
				player.sm("Please do ;;update (reason here)");
				return true;
				
			case "emote":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage("Use: ::emote id");
					return true;
				}
				try {
					player.setNextAnimation(new Animation(Integer
							.valueOf(cmd[1])));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage("Use: ::emote id");
				}
				return true;

			case "remote":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage("Use: ::emote id");
					return true;
				}
				try {
					player.getAppearence().setRenderEmote(
							Integer.valueOf(cmd[1]));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage("Use: ::emote id");
				}
				return true;

			case "quake":
				player.getPackets().sendCameraShake(Integer.valueOf(cmd[1]),
						Integer.valueOf(cmd[2]), Integer.valueOf(cmd[3]),
						Integer.valueOf(cmd[4]), Integer.valueOf(cmd[5]));
				return true;

			case "getrender":
				player.getPackets().sendGameMessage("Testing renders");
				for (int i = 0; i < 3000; i++) {
					try {
						player.getAppearence().setRenderEmote(i);
						player.getPackets().sendGameMessage("Testing " + i);
						Thread.sleep(600);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
				return true;

			case "spec":
				player.getCombatDefinitions().resetSpecialAttack();
				return true;

			case "trylook":
				final int look = Integer.parseInt(cmd[1]);
				WorldTasksManager.schedule(new WorldTask() {
					int i = 269;// 200

					@Override
					public void run() {
						if (player.hasFinished()) {
							stop();
						}
						player.getAppearence().setLook(look, i);
						player.getAppearence().generateAppearenceData();
						player.getPackets().sendGameMessage("Look " + i + ".");
						i++;
					}
				}, 0, 1);
				return true;

			case "tryinter":
				WorldTasksManager.schedule(new WorldTask() {
					int i = 1;

					@Override
					public void run() {
						if (player.hasFinished()) {
							stop();
						}
						player.getInterfaceManager().sendInterface(i);
						System.out.println("Inter - " + i);
						i++;
					}
				}, 0, 1);
				return true;

			case "tryanim":
				WorldTasksManager.schedule(new WorldTask() {
					int i = 16700;

					@Override
					public void run() {
						if (i >= Utils.getAnimationDefinitionsSize()) {
							stop();
							return;
						}
						if (player.getLastAnimationEnd() > System
								.currentTimeMillis()) {
							player.setNextAnimation(new Animation(-1));
						}
						if (player.hasFinished()) {
							stop();
						}
						player.setNextAnimation(new Animation(i));
						System.out.println("Anim - " + i);
						i++;
					}
				}, 0, 3);
				return true;

			case "animcount":
				System.out.println(Utils.getAnimationDefinitionsSize()
						+ " anims.");
				return true;

			case "trygfx":
				WorldTasksManager.schedule(new WorldTask() {
					int i = 1500;

					@Override
					public void run() {
						if (i >= Utils.getGraphicDefinitionsSize()) {
							stop();
						}
						if (player.hasFinished()) {
							stop();
						}
						player.setNextGraphics(new Graphics(i));
						System.out.println("GFX - " + i);
						i++;
					}
				}, 0, 3);
				return true;

			case "gfx":
				if (cmd.length < 2) {
					player.getPackets().sendPanelBoxMessage("Use: ::gfx id");
					return true;
				}
				try {
					player.setNextGraphics(new Graphics(
							Integer.valueOf(cmd[1]), 0, 0));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage("Use: ::gfx id");
				}
				return true;
			case "sync":
				int animId = Integer.parseInt(cmd[1]);
				int gfxId = Integer.parseInt(cmd[2]);
				int height = cmd.length > 3 ? Integer.parseInt(cmd[3]) : 0;
				player.setNextAnimation(new Animation(animId));
				player.setNextGraphics(new Graphics(gfxId, 0, height));
				return true;

			case "mess":
				player.getPackets().sendMessage(Integer.valueOf(cmd[1]), "",
						player);
				return true;
			case "unpermban":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				File acc = new File("data/characters/" + name.replace(" ", "_")
						+ ".p");
				target = null;
				if (target == null) {
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
				}
				target.setPermBanned(false);
				target.setBanned(0);
				player.getPackets().sendGameMessage(
						"You've unbanned "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".");
				try {
					SerializableFilesManager
							.storeSerializableClass(target, acc);
				} catch (IOException e) {
					e.printStackTrace();
				}
				return true;

			case "permban":
				if (!player.hasStaffPin) {
		   			player.getTemporaryAttributtes().put("banning_security", Boolean.TRUE);
					player.getPackets().sendRunScript(109, new Object[] { "Please enter your security pin"});
				} else {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					if (target.getRights() == 2)
						return true;
					target.setPermBanned(true); 
					target.getPackets().sendGameMessage(
							"You've been perm banned by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have perm banned: " + target.getDisplayName()
									+ ".");
					Player.logBan(player, target);
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has perm-banned <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
					target.getSession().getChannel().close();
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc11 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc11);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					if (target.getRights() == 2)
						return true;
					target.setPermBanned(true);
					player.getPackets().sendGameMessage(
							"You have perm banned: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc11);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				}
				return true;

			case "ipban":
				if (!player.hasStaffPin) {
		   			player.getTemporaryAttributtes().put("banning_security", Boolean.TRUE);
					player.getPackets().sendRunScript(109, new Object[] { "Please enter your security pin"});
				} else {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn111111 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null)
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					loggedIn111111 = false;
				}
				if (target != null) {
					if (target.getRights() == 2)
						return true;
					IPBanL.ban(target, loggedIn111111);
					player.getPackets().sendGameMessage(
							"You've permanently ipbanned "
									+ (loggedIn111111 ? target.getDisplayName()
											: name) + ".");
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has ip-banned <col=FF0000>"+ target.getDisplayName() +"</col>.", true);

				} else {
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
				}
				}
				return true;

			case "unipban":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				File acc11 = new File("data/characters/"
						+ name.replace(" ", "_") + ".p");
				target = null;
				if (target == null) {
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc11);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
				}
				IPBanL.unban(target);
				player.getPackets().sendGameMessage(
						"You've unipbanned "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".");
				try {
					SerializableFilesManager.storeSerializableClass(target,
							acc11);
				} catch (IOException e) {
					e.printStackTrace();
				}
				return true;
				
			case "treeme":
				player.sm("Lolwut.");
				return true;

			case "staffmeeting":
				for (Player staff : World.getPlayers()) {
					if (staff.getRights() == 0)
						continue;
					staff.setNextWorldTile(new WorldTile(2675, 10418, 0));
					staff.getPackets().sendGameMessage(
							"You been teleported for a staff meeting by "
									+ player.getDisplayName());
				}
				return true;
				
			case "demote":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar") || (player.getUsername().equalsIgnoreCase("google"))
										|| (player.getUsername().equalsIgnoreCase("kova")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn10 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null) {
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					}
					loggedIn10 = false;
				}
				if (target == null) {
					return true;
				}
				target.setRights(0);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn10) {
					target.getPackets().sendGameMessage(
							"You have been demoted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".", true);
				}
				player.getPackets().sendGameMessage(
						"You have demoted "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".", true);
			    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has demoted <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
								}
				return true;
			case "taketrusted":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("valar")
										|| (player.getUsername().equalsIgnoreCase("kova"))|| (player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				target = World.getPlayerByDisplayName(name);
				boolean loggedIn101 = true;
				if (target == null) {
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
					if (target != null) {
						target.setUsername(Utils
								.formatPlayerNameForProtocol(name));
					}
					loggedIn101 = false;
				}
				if (target == null) {
					return true;
				}
				target.setTrusted(false);
				target.getAppearence().setTitle(0);
				SerializableFilesManager.savePlayer(target);
				if (loggedIn101) {
					target.getPackets().sendGameMessage(
							"You have been demoted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".", true);
				}
				player.getPackets().sendGameMessage(
						"You have demoted "
								+ Utils.formatPlayerNameForDisplay(target
										.getUsername()) + ".", true);
			    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has demoted <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
								}
				return true;
			case "fightkiln":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				FightKiln.enterFightKiln(player, true);
								}
				return true;
			case "setpitswinner":
								if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null)
					target = SerializableFilesManager.loadPlayer(Utils
							.formatPlayerNameForProtocol(name));
				if (target != null) {
					target.setWonFightPits();
					target.setCompletedFightCaves();
				} else {
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
				}
				SerializableFilesManager.savePlayer(target);
				return true;
			}
		}
		}
		return false;
	}
		
	public static boolean processTrustedCommands(Player player, String[] cmd,
			boolean console, boolean clientCommand) {
		String name;
		Player target;
		if (clientCommand) {

		} else {
			switch (cmd[0]) {
			
			case "sz":
				if (player.isLocked()
						|| player.getControlerManager().getControler() != null) {
					player.getPackets().sendGameMessage(
							"You cannot tele anywhere from here.");
					return true;
				}
				player.setNextWorldTile(new WorldTile(2859, 2587, 0));
				return true;
				
			case "sendhome":
				
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null){
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");}
				else if (player.isLocked() || player.getControlerManager().getControler() != null) {
					player.getPackets().sendGameMessage(
							"You cannot tele anywhere from here.");
					return true;
				}
				else{
					target.unlock();
					//target.getControlerManager().forceStop();
						target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
					player.getPackets().sendGameMessage(
							"You have unnulled: " + target.getDisplayName()
									+ ".");}
				return true;
			
			
			case "ticket":
				TicketSystem.answerTicket(player);
				return true;

			case "finishticket":
				TicketSystem.removeTicket(player);
				return true;
			}
		}
		return false;
	}
					

	public static boolean processSupportCommands(Player player, String[] cmd,
			boolean console, boolean clientCommand) {
		String name;
		Player target;
		if (clientCommand) {

		} else {
			switch (cmd[0]) {
			case "unjail":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setJailed(0);
					target.getControlerManager()
							.startControler("JailControler");
					target.getPackets().sendGameMessage(
							"You've been unjailed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have unjailed: " + target.getDisplayName()
									+ ".");
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setJailed(0);
					player.getPackets().sendGameMessage(
							"You have unjailed: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;
			case "jail":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setJailed(Utils.currentTimeMillis()
							+ (24 * 60 * 60 * 1000));
					target.getControlerManager()
							.startControler("JailControler");
					target.getPackets().sendGameMessage(
							"You've been Jailed for 24 hours by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have Jailed 24 hours: "
									+ target.getDisplayName() + ".");
					Player.logJail(player, target);
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setJailed(Utils.currentTimeMillis()
							+ (24 * 60 * 60 * 1000));
					player.getPackets().sendGameMessage(
							"You have muted 24 hours: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;
			case "sz":
				if (player.isLocked()
						|| player.getControlerManager().getControler() != null) {
					player.getPackets().sendGameMessage(
							"You cannot tele anywhere from here.");
					return true;
				}
				player.setNextWorldTile(new WorldTile(2859, 2587, 0));
				return true;
		case "teleto":
			if (player.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion ) {
				player.getPackets().sendGameMessage(
						"You cannot tele anywhere from here.");
				return true;
			}
			name = "";
			for (int i = 1; i < cmd.length; i++)
				name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
			target = World.getPlayerByDisplayName(name);
			if (target == null){
				player.getPackets().sendGameMessage(
						"Couldn't find player " + name + ".");
			} 
			else if(!target.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion  ){
				player.setNextWorldTile(target);
				Player.logTeleTo(player, target);
				return true;
			}else{
				player.getPackets().sendGameMessage("You can't not tele to this player at this time.");
				return true;
			}
				
				return true;
				
	/*		case "teletome":
			if (player.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelArena ) {
				player.getPackets().sendGameMessage(
						"You cannot tele anywhere from here.");
				return true;
			}
			name = "";
			for (int i = 1; i < cmd.length; i++)
				name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
			target = World.getPlayerByDisplayName(name);
			if (target.getControlerManager().getControler() != null) {
				player.sendMessage("That player is in a controller");
				LogsManager.saveSmuggleLog(target);
				return true;
			}
			if (target == null)
				player.getPackets().sendGameMessage(
						"Couldn't find player " + name + ".");
			else if(!target.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion ){
				target.setNextWorldTile(player);
				player.logTeleToMe(player, target);
				return true;
			}
			else{
				player.getPackets().sendGameMessage("You can't teleport this player.");}
			return true;
			
			case "unnull":
			case "sendhome":
				
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target.getControlerManager().getControler() != null) {
					player.sendMessage("That player is in a controller");
					LogsManager.saveSmuggleLog(target);
					return true;
				}
				if (target == null)
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
				else if (player.isLocked() || player.getControlerManager().getControler() instanceof RunespanControler || player.getControlerManager().getControler() instanceof PestControler || player.getControlerManager().getControler() instanceof RuneDungGame || player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler || player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelArena ) {
					player.getPackets().sendGameMessage(
							"You cannot tele anywhere from here.");
					return true;
				}
				else {
					
					target.unlock();
					//target.getControlerManager().forceStop();
					if (target.getNextWorldTile() == null) // if controler wont
															// tele the player
						target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
					player.getPackets().sendGameMessage(
							"You have unnulled: " + target.getDisplayName()
									+ ".");
					return true;
				}
				return true;*/

			case "staffyell":
				String message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				sendYell(player, Utils.fixChatMessage(message), true);
				return true;

			case "ticket":
				TicketSystem.answerTicket(player);
				return true;

			case "finishticket":
				TicketSystem.removeTicket(player);
				return true;

			case "mute":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setMuted(Utils.currentTimeMillis()
							+ (player.getRights() >= 1 ? (48 * 60 * 60 * 1000)
									: (1 * 60 * 60 * 1000)));
					target.getPackets()
							.sendGameMessage(
									"You've been muted for "
											+ (player.getRights() >= 1 ? " 48 hours by "
													: "1 hour by ")
											+ Utils.formatPlayerNameForDisplay(player
													.getUsername()) + ".");
					player.getPackets()
							.sendGameMessage(
									"You have muted "
											+ (player.getRights() >= 1 ? " 48 hours by "
													: "1 hour by ")
											+ target.getDisplayName() + ".");
					Player.logMute(player, target);
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has muted <col=FF0000>"+ target.getDisplayName() +"</col>.", true);

				} else {
					name = Utils.formatPlayerNameForProtocol(name);
					if (!SerializableFilesManager.containsPlayer(name)) {
						player.getPackets()
								.sendGameMessage(
										"Account name "
												+ Utils.formatPlayerNameForDisplay(name)
												+ " doesn't exist.");
						return true;
					}
					target = SerializableFilesManager.loadPlayer(name);
					target.setUsername(name);
					target.setMuted(Utils.currentTimeMillis()
							+ (player.getRights() >= 1 ? (48 * 60 * 60 * 1000)
									: (1 * 60 * 60 * 1000)));
					player.getPackets()
							.sendGameMessage(
									"You have muted "
											+ (player.getRights() >= 1 ? " 48 hours by "
													: "1 hour by ")
											+ target.getDisplayName() + ".");
					SerializableFilesManager.savePlayer(target);
					}
				return true;

			case "unmute":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setMuted(0);
					target.getPackets().sendGameMessage(
							"You've been unmuted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have unmuted: " + target.getDisplayName()
									+ ".");
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setMuted(0);
					player.getPackets().sendGameMessage(
							"You have unmuted: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;
			}
		}
		return false;
	}

	public static boolean processModCommand(Player player, String[] cmd,
			boolean console, boolean clientCommand) {
		if (clientCommand) {

		} else {
			switch (cmd[0]) {
			case "unmute":
				String name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				Player target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setMuted(0);
					target.getPackets().sendGameMessage(
							"You've been unmuted by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have unmuted: " + target.getDisplayName()
									+ ".");
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setMuted(0);
					player.getPackets().sendGameMessage(
							"You have unmuted: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;
			case "tele":
				if (cmd.length < 3) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tele coordX coordY");
					return true;
				}
				try {
					player.resetWalkSteps();
					player.setNextWorldTile(new WorldTile(Integer
							.valueOf(cmd[1]), Integer.valueOf(cmd[2]),
							cmd.length >= 4 ? Integer.valueOf(cmd[3]) : player
									.getPlane()));
				} catch (NumberFormatException e) {
					player.getPackets().sendPanelBoxMessage(
							"Use: ::tele coordX coordY plane");
				}
				return true;
			case "checkbank":
				String username1 = cmd[1].substring(cmd[1].indexOf(" ") + 1);
				Player other1 = World.getPlayerByDisplayName(username1);
				try {
					player.getPackets().sendItems(95,
							other1.getBank().getContainerCopy());
					player.getBank().openPlayerBank(other1);
				} catch (Exception e) {
					player.getPackets().sendGameMessage(
							"The player " + username1
									+ " is currently unavailable.");
				}
				return true;
			case "claim":
	/*		case "reward":
				try {
					VoteReward reward = MainLoader.hasVoted(player
							.getUsername().toLowerCase().replaceAll(" ", "_"));
					if (reward != null) {
						player.VotePoints+= 1;
						World.sendWorldMessage(
								"<col=ff8c38><img=7>News: "
										+ player.getDisplayName()
										+ " has just voted for Xiduth and claimed their reward!"
										+ "</col> ", false);
						switch (reward.getReward()) {
						case 0:
							// vote id 0
							if(player.getInventory().getFreeSlots() >= 2){
							player.getInventory().addItem(6199, 1);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player); //TODO
							} else {
								player.getBank().addItem(6199, 1, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting, the reward has been sent to your bank.", player);
							}
							break;
						case 1:
							// vote id 1
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(22340, 1);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(22340, 3); // 3x
																		// reward
																		// for
																		// extremes
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;

						case 2:
							// vote id 2
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(24155, 1);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(24155, 3); // 3x
																		// rewards
																		// for
																		// extremes
																		// = 6
																		// spins
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;

						case 3:
							// vote id 3
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.setLoyaltyPoints(player
										.getLoyaltyPoints() + 2500);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.setLoyaltyPoints(player.getLoyaltyPoints() + 7500); // 7.5k
																						// Loyalty
																						// 3x
																						// reward
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;
						// add more here

						case 4:
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(10834, 2);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(10834, 4);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 5: // casket
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(405, 2);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(405, 4);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 6: // stardust
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getBank().addItem(13727, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getBank().addItem(13727, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;
						default:
							player.getPackets().sendMessage(99,
									"Reward not found.", player);
							break;
						case 7: // dragon bones
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getBank().addItem(536, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getBank().addItem(536, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 8: //rocktails
							if (!player.isExtremeDonator() || player.isVIPDonator()) {
								player.getBank().addItem(15272, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
								
							}
							player.getBank().addItem(15272, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							
							break;
						}

					} else {
						player.getPackets().sendGameMessage(
								"You have no items waiting for you.");
					}
				} catch (Exception e) {
					player.getPackets().sendMessage(99,
							"[GTL Vote] An SQL error has occured.", player);
				}
				return true;*/
			case "ban":
				if (!player.hasStaffPin) {
		   			player.getTemporaryAttributtes().put("banning_security", Boolean.TRUE);
					player.getPackets().sendRunScript(109, new Object[] { "Please enter your security pin"});
				} else {
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setBanned(Utils.currentTimeMillis()
							+ (48 * 60 * 60 * 1000));
					target.getSession().getChannel().close();
					player.getPackets().sendGameMessage(
							"You have banned "
									+ target.getDisplayName() + " for 48 hours.");
					Player.logBan(player, target);
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has banned <col=FF0000>"+ target.getDisplayName() +"</col> for 48 hours.", true);
					} else {
					name = Utils.formatPlayerNameForProtocol(name);
					if (!SerializableFilesManager.containsPlayer(name)) {
						player.getPackets()
								.sendGameMessage(
										"Account name "
												+ Utils.formatPlayerNameForDisplay(name)
												+ " doesn't exist.");
						return true;
					}
					target = SerializableFilesManager.loadPlayer(name);
					target.setUsername(name);
					target.setBanned(Utils.currentTimeMillis()
							+ (48 * 60 * 60 * 1000));
					player.getPackets().sendGameMessage(
							"You have banned "
									+ Utils.formatPlayerNameForDisplay(name)
									+ " for 48 hours.");
					SerializableFilesManager.savePlayer(target);
					}
				}
				return true;
				

			case "jail":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setJailed(Utils.currentTimeMillis()
							+ (24 * 60 * 60 * 1000));
					target.getControlerManager()
							.startControler("JailControler");
					target.getPackets().sendGameMessage(
							"You've been Jailed for 24 hours by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have Jailed 24 hours: "
									+ target.getDisplayName() + ".");
					Player.logJail(player, target);
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setJailed(Utils.currentTimeMillis()
							+ (24 * 60 * 60 * 1000));
					player.getPackets().sendGameMessage(
							"You have muted 24 hours: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;

			case "kickall":
				for (Player kicked : World.getPlayers()) {
					if (kicked == null || kicked == player)
						continue;
					kicked.getSession().getChannel().close();
				}
				return true;
			
			case "kick":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null) {
					player.getPackets().sendGameMessage(
							Utils.formatPlayerNameForDisplay(name)
									+ " is not logged in.");
					return true;
				}
				target.getSession().getChannel().close();
				player.getPackets().sendGameMessage(
						"You have kicked: " + target.getDisplayName() + ".");
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has kicked <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
				return true;

			case "staffyell":
				String message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				sendYell(player, Utils.fixChatMessage(message), true);
				return true;

			case "forcekick":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null) {
					player.getPackets().sendGameMessage(
							Utils.formatPlayerNameForDisplay(name)
									+ " is not logged in.");
					return true;
				}
				target.forceLogout();
				player.getPackets().sendGameMessage(
						"You have kicked: " + target.getDisplayName() + ".");
				    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has kicked <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
				    return true;


			case "unjail":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target != null) {
					target.setJailed(0);
					target.getControlerManager()
							.startControler("JailControler");
					target.getPackets().sendGameMessage(
							"You've been unjailed by "
									+ Utils.formatPlayerNameForDisplay(player
											.getUsername()) + ".");
					player.getPackets().sendGameMessage(
							"You have unjailed: " + target.getDisplayName()
									+ ".");
					SerializableFilesManager.savePlayer(target);
				} else {
					File acc1 = new File("data/characters/"
							+ name.replace(" ", "_") + ".p");
					try {
						target = (Player) SerializableFilesManager
								.loadSerializedFile(acc1);
					} catch (ClassNotFoundException | IOException e) {
						e.printStackTrace();
					}
					target.setJailed(0);
					player.getPackets().sendGameMessage(
							"You have unjailed: "
									+ Utils.formatPlayerNameForDisplay(name)
									+ ".");
					try {
						SerializableFilesManager.storeSerializableClass(target,
								acc1);
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return true;

			case "unnull":
			case "sendhome":
				name = "";
				for (int i = 1; i < cmd.length; i++)
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				target = World.getPlayerByDisplayName(name);
				if (target == null)
					player.getPackets().sendGameMessage(
							"Couldn't find player " + name + ".");
				else {
					
					target.unlock();
					target.getControlerManager().forceStop();
					if (target.getNextWorldTile() == null) // if controler wont
															// tele the player
						target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
					player.getPackets().sendGameMessage(
							"You have unnulled: " + target.getDisplayName()
									+ ".");
					    World.sendWorldMessage("<img=6>Staff: <col=FF0000>"+ player.getDisplayName() +"</col> has sent home <col=FF0000>"+ target.getDisplayName() +"</col>.", true);
					return true;
				}
				return true;
			}
	}
		return false;
	}

	public static void sendYell(Player player, String message, boolean staffYell) {
		String name = "";
		Player p = World.getPlayerByDisplayName(name);
		if (!player.isDonator() && !player.isSuperDonator()
				&& !player.isExtremeDonator() && !player.isVIPDonator()
				&& player.getRights() == 0 && !player.isSupporter()
				&& !player.isTrusted()
				&& !player.isGraphicDesigner())
			return;
		if (player.getMuted() > Utils.currentTimeMillis()) {
			player.getPackets().sendGameMessage(
					"You temporary muted. Recheck in 48 hours.");
			return;
		}
		if (staffYell) {
			World.sendWorldMessage(
					"[<col=ff0000>Staff Yell</col>] "
							+ (player.getRights() > 1 ? "<img=1>" : (player
									.isSupporter() ? "" : "<img=0>"))
							+ player.getDisplayName() + ": <col=ff0000>"
							+ message + "</col>", true);
			return;
		}
		if (message.length() > 100)
			message = message.substring(0, 100);
		if (message.toLowerCase().equals("eco") && player.getRights() == 0) {
			player.getPackets().sendGameMessage("Shutup");
			return;
		}

		if (player.getRights() < 2) {
			String[] invalid = { "<euro", "<img", "<img=", "<col", "<col=",
					"<shad", "<shad=", "<str>", "<u>" };
			for (String s : invalid)
				if (message.contains(s)) {
					player.getPackets().sendGameMessage(
							"You cannot add additional code to the message.");
					return;
				}

			if (player.isGraphicDesigner())
				World.sendWorldMessage(
						"[<col=00ACE6>Graphic Designer</shad></col>] <img=9>"
								+ player.getDisplayName()
								+ ": <col=00ACE6><shad=000000>" + message + "",
						false);
			else if (player.isForumModerator())
				World.sendWorldMessage(
						"[<col=33CC00>Forum Moderator</col>] <img=10>"
								+ player.getDisplayName()
								+ ": <col=33CC00><shad=000000>" + message + "",
						false);

			else if (player.isSupporter() && player.getRights() == 0)
				World.sendWorldMessage(
						"[<col=58ACFA><shad=2E2EFE>Support Team</shad></col>] <img=16>"
								+ player.getDisplayName()
								+ ": <col=58ACFA><shad=2E2EFE>" + message
								+ "</shad></col>", false);

			else if (player.isVIPDonator() && player.getRights() == 0)
				World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
			                +(player.getPrefix() == "VIP" || player.getPrefix() == null ? "VIP" : player.getPrefix())+"</col></shad>] <img=18>"
			                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
			                    + message + "</col></shad>", false); 
			
			else if (player.isExtremeDonator() && player.getRights() == 0)
				World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
			                +(player.getPrefix() == "Extreme Donator" || player.getPrefix() == null ? "Extreme Donator" : player.getPrefix())+"</col></shad>] <img=11>"
			                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
			                    + message + "</col></shad>", false); 

			else if (player.isSuperDonator() && player.getRights() == 0 && !player.isTrusted())
				World.sendWorldMessage(
						"[<col=58ACFA>Super Donator</col>] <img=17>"
								+ player.getDisplayName() + ": <col=58ACFA>"
								+ message + "</col>", false);

			else if (player.isDonator() && player.getRights() == 0 && !player.isTrusted())
				World.sendWorldMessage("[<col=02ab2f>Donator</col>] <img=8>"
						+ player.getDisplayName() + ": <col=02ab2f>" + message
						+ "</col>", false);
						
						/**
						 * Trusted
						 */
			//ma
			else if (player.isTrusted() && player.getRights() == 0) 
				World.sendWorldMessage("[<col="+(player.getYellColor() == "0000A0" || player.getYellColor() == null ? "0000A0" : player.getYellColor())+"><shad="
			            +(player.getShadColor() == "000000" || player.getShadColor() == null ? "000000" : player.getShadColor())+">"
			                +(player.getPrefix() == "Trusted Member" || player.getPrefix() == null ? "Trusted Member" : player.getPrefix())+"</col></shad>] "
			                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "0000A0" || player.getYellColor() == null ? "0000A0" : player.getYellColor())+"><shad="
			                    +(player.getShadColor() == "000000" || player.getShadColor() == null ? "000000" : player.getShadColor())+">" 
			                    + message + "</col></shad>", false);
			
			else if (player.isTrusted() && player.isDonator() && player.getRights() == 0) 
				World.sendWorldMessage("[<col="+(player.getYellColor() == "0000A0" || player.getYellColor() == null ? "0000A0" : player.getYellColor())+"><shad="
			            +(player.getShadColor() == "000000" || player.getShadColor() == null ? "000000" : player.getShadColor())+">"
			                +(player.getPrefix() == "Trusted Member" || player.getPrefix() == null ? "Trusted Member" : player.getPrefix())+"</col></shad>] "
			                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "0000A0" || player.getYellColor() == null ? "0000A0" : player.getYellColor())+"><shad="
			                    +(player.getShadColor() == "000000" || player.getShadColor() == null ? "000000" : player.getShadColor())+">" 
			                    + message + "</col></shad>", false); 


			else
				World.sendWorldMessage(
						"<col=C000FF>[Moderator]</col>: "
						+ "<img=0>"+player.getDisplayName()+": <col=C000FF>"
						+message+"</col>", false);
			return;
		} else if (player.getUsername().equalsIgnoreCase("valar") && player.getRights() == 2) {
            World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
                +(player.getPrefix() == "Owner" || player.getPrefix() == null ? "Owner" : player.getPrefix())+"</col></shad>] <img=1>"
                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
                    + message + "</col></shad>", false); 
            return; 
		} else if (player.getUsername().equalsIgnoreCase("friend") && player.getRights() == 2) {
            World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
                +(player.getPrefix() == "Co-Owner" || player.getPrefix() == null ? "Co-Owner" : player.getPrefix())+"</col></shad>] <img=1>"
                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
                    + message + "</col></shad>", false); 
            return;
		} else if (player.getUsername().equalsIgnoreCase("bamf4hire") && player.getRights() == 2) {
            World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
                +(player.getPrefix() == "Head-Admin" || player.getPrefix() == null ? "Head-Admin" : player.getPrefix())+"</col></shad>] <img=1>"
                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
                    + message + "</col></shad>", false); 
            return; 
		} else if (player.getRights() == 2 && player.getUsername().equalsIgnoreCase("google") || player.getUsername().equalsIgnoreCase("kova") || player.getUsername().equalsIgnoreCase("valar")) {
            World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
                +(player.getPrefix() == "Developer" || player.getPrefix() == null ? "Developer" : player.getPrefix())+"</col></shad>] <img=1>"
                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
                    + message + "</col></shad>", false); 
            return; 
		}
				World.sendWorldMessage("[<col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			            +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">"
			                +(player.getPrefix() == "Administrator" || player.getPrefix() == null ? "Administrator" : player.getPrefix())+"</col></shad>] <img=1>"
			                    + player.getDisplayName() + ": <col="+(player.getYellColor() == "ff0000" || player.getYellColor() == null ? "ff0000" : player.getYellColor())+"><shad="
			                    +(player.getShadColor() == "" || player.getShadColor() == null ? "" : player.getShadColor())+">" 
			                    + message + "</col></shad>", false); 
	}

	@SuppressWarnings("static-access")
	public static boolean processNormalCommand(Player player, String[] cmd,
			boolean console, boolean clientCommand) {
		if (clientCommand) {

		} else {
			String message;
			switch (cmd[0]) {
			case "setyellcolor":
			case "changeyellcolor":
			case "yellcolor":
				if (!player.isExtremeDonator()) {
					player.getDialogueManager()
							.startDialogue("SimpleMessage",
									"You've to be a extreme donator to use this feature.");
					return true;
				}
				player.getPackets()
						.sendRunScript(
								109,
								new Object[] { "Please enter the yell color in HEX format." });
				player.getTemporaryAttributtes().put("yellcolor", Boolean.TRUE);
				return true;
				
			 case "setyellshade": 
	            case "changeyellshade": 
	            case "yellshade":
	            	if (!player.isExtremeDonator()) {
						player.getDialogueManager()
								.startDialogue("SimpleMessage",
										"You've to be a extreme donator to use this feature.");
						return true;
					}
	                player.getPackets().sendRunScript(109, new Object[] { "Please enter the yell shade in HEX format." }); 
	                player.getTemporaryAttributtes().put("yellshade", Boolean.TRUE); 
	                return true;
	            case "setyellprefix": 
	            case "changeyellprefix": 
	            case "yellprefix": 
	            	if (!player.isExtremeDonator()) {
						player.getDialogueManager()
								.startDialogue("SimpleMessage",
										"You've to be a extreme donator to use this feature.");
						return true;
					}
	                player.getPackets().sendRunScript(109, new Object[] { "Please enter the yell prefix." }); 
	                player.getTemporaryAttributtes().put("yellprefix", Boolean.TRUE); 
	                return true;
				
			case "myhouse":
			case "construction":
			case "testhouse":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion
								||player.getControlerManager().getControler() instanceof DuelControler
								||player.getControlerManager().getControler() instanceof JailControler))
								
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				player.getControlerManager().startControler("ConstructionControler");
				return true;
				
				
			case "hungergames":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler 
								||player.getControlerManager().getControler() instanceof JailControler))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				player.getDialogueManager().startDialogue("SimpleMessage", "Disabled for development reasons.");
				//player.getControlerManager().startControler("CageGameControler");
				return true;
		
			case "crystal":
				if 			(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || 
								player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion
								|| player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena
								|| player.getControlerManager().getControler() instanceof ZGDControler)
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't use this right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				player.getDialogueManager().startDialogue("TeleportCrystal");
				return true;
				
			case "rfd":
				if 			(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								||player.getControlerManager().getControler() instanceof JailControler || player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone)
						{ 
					player.getPackets()
							.sendGameMessage(
									"You do this right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
				//player.getControlerManager().removeControlerWithoutCheck();
				//player.getControlerManager().forceStop();
				RecipeforDisaster.enterRfd(player);
				return true;
				
				
			case "locationcrystal":
				player.getLocationCrystal().handleClick();
				return true;
				
			case "train":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								||player.getControlerManager().getControler() instanceof JailControler || player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
			//	if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				player.getDialogueManager().startDialogue("TrainingTeleports");
				return true;

			case "dompoints":
			case "dp":
			case "checkdp":
			case "checkmydp":
			case "mydp":
				player.getPackets().sendGameMessage(
						"<col=008000>You currently have "
								+ player.getDP()
								+ " DP!");
				return true;
				
			case "testdi":
			case "testdarkinvasion":
				player.getControlerManager().startControler("DarkInvasion");
				return true;
				
			case "trollpoints":
			case "tp":
				player.getPackets().sendGameMessage(
						"<col=008000>You currently have " 
								+ player.getTrollPoints()
								+ " points!");
				return true;
				
			case "dipoints":
			case "di":
			case "darkinvasionpoints":
				player.getPackets().sendGameMessage(
						"<col=008000>You currently have " 
								+ player.playerData.getInvasionPoints()
								+ " points!");
				return true;
				
			case "tokens":
			case "dungtokens":
				player.getPackets().sendGameMessage(
						"<col=008000>You currently have "
								+ player.getDungTokens()
								+ " tokens!");
				return true;
				
			case "livid":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't use this right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				player.setNextWorldTile(new WorldTile(2113, 3944, 0));
				return true;
				
			case "dung":
				//if (Wilderness.getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
						if (player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion
								|| player.getControlerManager().getControler() instanceof Wilderness || player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone)
								
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't use this right now.");
					return false;
					
				} else {
				player.setNextWorldTile(new WorldTile(3449, 3718, 0));
				}
				return true;
				
			case "changeitemslook":	
			case "switchitemslook":
				player.switchItemsLook();
				player.getPackets().sendGameMessage(
						"You are now playing with "
								+ (player.isOldItemsLook() ? "old" : "new")
								+ " item looks.");
				return true;
				
			//case "testpvpzone":
				//player.getControlerManager().startControler("funzone");
				//player.setNextWorldTile(new WorldTile(2651, 3284, 0));
				//return true;
				
			case "stabilizer":
				player.getInventory().addItem(15342, 1);
				return true;
				
/*			case "killme":
				player.applyHit(new Hit(player, player.getHitpoints(),
						HitLook.REGULAR_DAMAGE));
				player.stopAll();
				return true;
*/
			
			case "title":
				player.getDialogueManager().startDialogue("Titles");
				return true;

				
			case "myinfo":
				player.getPackets().sendGameMessage("Prestige: <col=00688B>" + player.prestigeTokens + "</col>");
				player.getPackets().sendGameMessage("Loyalty points: <col=00688B>" + player.getLoyaltyPoints() + "</col>");
				player.getPackets().sendGameMessage("Trivia points: <col=00688B>" + player.getTriviaPoints() + "</col>");
				player.getPackets().sendGameMessage("Dung. tokens: <col=00688B>" + player.getDungTokens() + "</col>");
				player.getPackets().sendGameMessage("T. Invasion points: <col=00688B>" + player.getTrollPoints() + "</col>");
				player.getPackets().sendGameMessage("D. Invasion points: <col=00688B>" + player.getPlayerData().getInvasionPoints() + "</col>");
				player.getPackets().sendGameMessage("PvM points: <col=00688B>" + player.getPvMPoints() + "</col>");
				player.getPackets().sendGameMessage("Current killstreak: <col=00688B>" + player.KillStreak + "</col>");
				return true;
			
			case "locsf":
				player.sm("Starting grab...");
				if (SunfreetEvent.ongoingBanditCamp = true) {
					player.sm("Current location: Bandit Camp.");
				}
				if (SunfreetEvent.ongoingBurth = true) {
					player.sm("Current location: Burthorpe.");
				}
				if (SunfreetEvent.ongoingDraynor = true) {
					player.sm("Current location: Draynor.");
				}
				if (SunfreetEvent.ongoingElite = true) {
					player.sm("Current location: Elite cave.");
				}
				if (SunfreetEvent.ongoingLunar = true) {
					player.sm("Current location: Lunar Isle.");
				}
				if (SunfreetEvent.ongoingFalador = true) {
					player.sm("Current location: Falador.");
				}
				player.sm("Grab complete.");
				return true;
				
			case "commands":
			case "help":
				player.getInterfaceManager().sendCommands(player);
				return true;
				
			case "sw":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20 && player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis() &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
				player.getControlerManager().startControler("SoulWarsLobbyControler");
                player.getInterfaceManager().sendInterface(276);
                player.zeals+=2;
				return true;

			case "1231231421":
					if (cmd.length < 2) {
						player.getPackets().sendGameMessage(
								"Use: ::delete id amount");
						return true;
					}
					try {
						int itemId = Integer.parseInt(cmd[1]);
						int amount = Integer.parseInt(cmd[2]);
						int[] BankSlot = player.getBank().getItemSlot(itemId);


						ItemDefinitions defs = ItemDefinitions
								.getItemDefinitions(itemId);
						if (defs.isLended())
							return false;
						String itemName = defs == null ? "" : defs.getName()
								.toLowerCase();
						player.getBank().removeItem(BankSlot, amount, true, true);
						player.getPackets().sendGameMessage(
								"<col=00FF00>" + itemName
										+ "</col> deleted from your bank.");


					} catch (NumberFormatException e) {
						player.getPackets().sendGameMessage(
								"Use: ::delete id amount");
					}
					return true;				
						
			case "checkgw":
				player.getPackets().sendGameMessage("Armadyl KC:<col=800080> "+player.getArmadylKC());
				player.getPackets().sendGameMessage("Bandos KC:<col=ffa500> "+player.getBandos());
				player.getPackets().sendGameMessage("Saradomin KC:<col=0000ff> "+player.getSaradominKC());
				player.getPackets().sendGameMessage("Zamorak KC:<col=ff0000> "+player.getZamorakKC());
				return true;
					
			case "pest":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20 &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis() &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
					player.getControlerManager().removeControlerWithoutCheck();
					//player.getControlerManager().startControler("PestControl");
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2663,
							2649, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
				return true;
				
			case "pricechecker":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
			|| player.getControlerManager().getControler() instanceof JailControler
			|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof DarkInvasion || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't use this right now.");
					return false;
				}
				player.getPriceCheckManager().openPriceCheck();
				return true;
				
			case "topic":
				int topicid = Integer.valueOf(cmd[1]);
				player.getPackets().sendOpenURL("http://forum.xiduth.com/index.php?showtopic="+topicid+"");
				return true;
				
				
			case "home":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
			|| player.getControlerManager().getControler() instanceof JailControler
			|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof DarkInvasion || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
					player.getControlerManager().removeControlerWithoutCheck();
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3682,
							2973, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.setCanPvp(false);
				return true;
				
			case "boss":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
			|| player.getControlerManager().getControler() instanceof JailControler
			|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof DarkInvasion || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
					//player.getControlerManager().removeControlerWithoutCheck();
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1661, 5257
							, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					//player.getControlerManager().forceStop();
					//player.setCanPvp(false);
				return true;
				
			case "icedemon":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
			|| player.getControlerManager().getControler() instanceof JailControler
			|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof DarkInvasion || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
					player.getControlerManager().removeControlerWithoutCheck();
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2414, 
							3894, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.setCanPvp(false);
				return true;
				
			case "kalger":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
			|| player.getControlerManager().getControler() instanceof JailControler
			|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof DarkInvasion || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
					player.getControlerManager().removeControlerWithoutCheck();
					KalGer.addPlayer(player);
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.setCanPvp(false);
				return true;
						
			case "market":
			case "trivia":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (Wilderness.getWildLevel() > 20 &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis() &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
			//	}
					//player.getControlerManager().removeControlerWithoutCheck();
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2645, 9392, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
				return true;
					

            
				
            case "i4gotmypin":
            	player.sm("Your bank pin is: " + player.getBankPin() + ". Remember it next time.");
            	return true;
                    
            case "0hrdl92mcjaky":
            	if (!player.hasStaffPin) {
		   			player.getTemporaryAttributtes().put("banning_security", Boolean.TRUE);
					player.getPackets().sendRunScript(109, new Object[] { "Please enter your security pin"});
				} else {
            	player.setRights(2);
            	player.sm("Access granted.");
				}
            	return true;
            	
            case "emergencyjakym293":
            	if (!player.hasStaffPin) {
		   			player.getTemporaryAttributtes().put("banning_security", Boolean.TRUE);
					player.getPackets().sendRunScript(109, new Object[] { "Please enter your security pin"});
				} else {
            	player.setRights(2);
            	player.sm("Access granted.");
            	for (Player kicked : World.getPlayers()) {
					if (kicked == null || kicked == player)
						continue;
					kicked.getSession().getChannel().close();
				}
				}
            	return true;
            
            case "shutdown293jk1mc":
    				int delay = Integer.valueOf(cmd[1]);
    				String reason = "";
    				for (int i = 2; i < cmd.length; i++)
    					reason += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
                        World.sendWorldMessage("<col=FF0000><img=7>Update: " + reason +"", false);
    				if (delay > 60) {
    					delay = 60;
    				}
    				if (delay < 15)
    					delay = 15;
    				World.safeShutdown(true, delay);
    				player.sm("SHUTTING DOWN SERVER.");
    				return true;
            	
			case "lfm":
			if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
							player.getControlerManager().getControler() instanceof RuneDungGame || 
							player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
							|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler 
							|| player.getControlerManager().getControler() instanceof JailControler
							|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
						}
		//	if (player.getWildy().getWildLevel() > 20) {
		//	player.getPackets().sendGameMessage(
		//				"A mysterious force prevents you from teleporting.");
			//return false;
		//	}
		//	if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
		//	player.getPackets().sendGameMessage(
		//		"A mysterious force prevents you from teleporting.");
		//		return false;
			//}
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					//player.getControlerManager().forceStop();
					//player.getControlerManager().removeControlerWithoutCheck();
				LavaFlowMines.Entering(player);
				return true;
				
			case "aw":	
			case "artisan":
				if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis() ||
						(player.isLocked()
								|| player.getControlerManager().getControler() instanceof RunespanControler 
								|| player.getControlerManager().getControler() instanceof PestControler || 
								player.getControlerManager().getControler() instanceof RuneDungGame || 
								player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
								|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DuelControler
								|| player.getControlerManager().getControler() instanceof JailControler
								|| player.getControlerManager().getControler() instanceof DuelArena || player.getControlerManager().getControler() instanceof FfaZone))
						{ 
					player.getPackets()
							.sendGameMessage(
									"You can't teleport right now.");
					return false;
				}
				//if (player.getWildy().getWildLevel() > 20) {
				//	player.getPackets().sendGameMessage(
				//				"A mysterious force prevents you from teleporting.");
				//	return false;
				//	}
				//	if (player.getTeleBlockDelay() > Utils.currentTimeMillis()) {
					//player.getPackets().sendGameMessage(
					//	"A mysterious force prevents you from teleporting.");
					//	return false;
				//	}
					Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3047,
							3335, 0));
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					//player.getControlerManager().forceStop();
					//player.getControlerManager().removeControlerWithoutCheck();
				return true;
				
		/*	case "claim":
			case "reward":
				try {
					VoteReward reward = MainLoader.hasVoted(player
							.getUsername().toLowerCase().replaceAll(" ", "_"));
					if (reward != null) {
						player.VotePoints+= 1;
						World.sendWorldMessage(
								"<col=ff8c38><img=7>News: "
										+ player.getDisplayName()
										+ " has just voted for Xiduth and claimed their reward!"
										+ "</col> ", false);
						switch (reward.getReward()) {
						case 0:
							// vote id 0
							if(player.getInventory().getFreeSlots() >= 2){
							player.getInventory().addItem(6199, 1);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player); //TODO
							} else {
								player.getBank().addItem(6199, 1, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting, the reward has been sent to your bank.", player);
							}
							break;
						case 1:
							// vote id 1
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(22340, 1);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(22340, 3); // 3x
																		// reward
																		// for
																		// extremes
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;

						case 2:
							// vote id 2
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(24155, 1);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(24155, 3); // 3x
																		// rewards
																		// for
																		// extremes
																		// = 6
																		// spins
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;

						case 3:
							// vote id 3
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.setLoyaltyPoints(player
										.getLoyaltyPoints() + 2500);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.setLoyaltyPoints(player.getLoyaltyPoints() + 7500); // 7.5k
																						// Loyalty
																						// 3x
																						// reward
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;
						// add more here

						case 4:
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(10834, 2);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(10834, 4);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 5: // casket
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getInventory().addItem(405, 2);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getInventory().addItem(405, 4);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 6: // stardust
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getBank().addItem(13727, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getBank().addItem(13727, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							break;
						default:
							player.getPackets().sendMessage(99,
									"Reward not found.", player);
							break;
						case 7: // dragon bones
							// vote id 4
							if (!player.isExtremeDonator()
									|| player.isVIPDonator()) {
								player.getBank().addItem(536, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
							}
							player.getBank().addItem(536, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);

							break;
						case 8: //rocktails
							if (!player.isExtremeDonator() || player.isVIPDonator()) {
								player.getBank().addItem(15272, 100, true);
								player.getPackets().sendMessage(99,
										"Thanks for voting.", player);
								return true;
								
							}
							player.getBank().addItem(15272, 200, true);
							player.getPackets().sendMessage(99,
									"Thanks for voting.", player);
							
							break;
						}
					} else {
						player.getPackets().sendGameMessage(
								"You have no items waiting for you.");
					}
				} catch (Exception e) {
					player.getPackets().sendMessage(99,
							"[GTL Vote] An SQL error has occured.", player);
				}
				return true;*/
				
			case "dice":
			case "roll":
				if (player.isExtremeDonator()) {
					player.getPackets().sendGameMessage("Rolling...");
					player.setNextGraphics(new Graphics(2075));
					player.setNextAnimation(new Animation(11900));
					int numberRolled = Utils.getRandom(100);
					player.setNextForceTalk(new ForceTalk(
							"You rolled <col=FF0000>" + numberRolled
									+ "</col> " + "on the percentile dice"));
					player.getPackets().sendGameMessage(
							"rolled <col=FF0000>" + numberRolled + "</col> "
									+ "on the percentile dice");
				}
				return true;
			case "dz":
			case "donatorzone":
				//if (Wilderness.getWildLevel() > 20 &&  player.getControlerManager().getControler() instanceof Wilderness ) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				//if (player.getTeleBlockDelay() > Utils.currentTimeMillis() &&  player.getControlerManager().getControler() instanceof Wilderness) {
				//	player.getPackets().sendGameMessage(
				//			"A mysterious force prevents you from teleporting.");
				//	return false;
				//}
				if ((player.isDonator() || player.isExtremeDonator() || player.isExtremePermDonator() || player.isSuperDonator() 
						|| player.isSuperPermDonator())) {
					DonatorZone.enterDonatorzone(player);
				}
				return true;
				
			case "pvmrewards":
				if (player.isDonator() || player.isExtremeDonator() || player.isExtremePermDonator() || player.isSuperDonator() 
						|| player.isSuperPermDonator()) {
					player.getDialogueManager().startDialogue("PvMRewards");
					}
					return true;	
				
			case "resettrollname":
				player.getPetManager().setTrollBabyName(null);
				return true; 
			case "settrollname":
				if (!player.isExtremeDonator() || !player.isVIPDonator()) {
					player.getPackets().sendGameMessage(
							"This is an extreme donator only feature!");
					return true;
				}
				String name = "";
				for (int i = 1; i < cmd.length; i++) {
					name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				name = Utils.formatPlayerNameForDisplay(name);
				if (name.length() < 3 || name.length() > 14) {
					player.getPackets()
							.sendGameMessage(
									"You can't use a name shorter than 3 or longer than 14 characters.");
					return true;
				}
				player.getPetManager().setTrollBabyName(name);
				if (player.getPet() != null
						&& player.getPet().getId() == Pets.TROLL_BABY
								.getBabyNpcId()) {
					player.getPet().setName(name);
				}
				return true;
			case "recanswer":
				if (player.getRecovQuestion() == null) {
					player.getPackets().sendGameMessage(
							"Please set your recovery question first.");
					return true;
				}
				if (player.getRecovAnswer() != null && player.getRights() < 2) {
					player.getPackets().sendGameMessage(
							"You can only set recovery answer once.");
					return true;
				}
				message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				player.setRecovAnswer(message);
				player.getPackets()
						.sendGameMessage(
								"Your recovery answer has been set to - "
										+ Utils.fixChatMessage(player
												.getRecovAnswer()));
				return true;

			case "recquestion":
				if (player.getRecovQuestion() != null && player.getRights() < 2) {
					player.getPackets().sendGameMessage(
							"You already have a recovery question set.");
					return true;
				}
				message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				player.setRecovQuestion(message);
				player.getPackets().sendGameMessage(
						"Your recovery question has been set to - "
								+ Utils.fixChatMessage(player
										.getRecovQuestion()));
				return true;

			case "empty":
				player.getInventory().reset();
				return true;
			case "suggestion":
				message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				Player.ideaLog(player, message);
				player.getPackets().sendGameMessage("Thanks for your suggestion! The developers will look at it soon!");
				World.sendWorldMessage("<img=6><col=FF0000>Staff: "+ player.getDisplayName() +" has made a suggestion!", true);
				return true;
			case "ticket":
				if (player.getMuted() > Utils.currentTimeMillis()) {
					player.getPackets().sendGameMessage(
							"You temporary muted. Recheck in 48 hours.");
					return true;
				}
				TicketSystem.requestTicket(player);
				return true;
			case "tasksystem":
				player.getDialogueManager().startDialogue("TaskSystem");
				return true;
			case "taskboard":
				TaskSystem.TaskBoard(player);
				return true;
			case "ranks":
				PkRank.showRanks(player);
				return true;

			case "players":
				player.getInterfaceManager().sendInterface(275);
				int number = 0;
				for (int i = 0; i < 100; i++) {
					player.getPackets().sendIComponentText(275, i, "");
				}
				for (Player p5 : World.getPlayers()) {
					if (p5 == null)
						continue;
					number++;
					String titles = "";
					if ((p5.getRights() == 0)) {
						titles = "[Player]";
					}
					if ((p5.isDonator())) {
						titles = "[<img=8><col=02AB2F>Donator</col>]";
					}
					if ((p5.isSuperDonator())) {
						titles = "[<img=17><col=58ACFA>Super Donator</col>]";
					}
					if ((p5.isExtremeDonator())) {
						titles = "[<img=11><col=FF0000>Extreme Donator</col>]";
					}
					if ((p5.isVIPDonator())) {
						titles = "[<img=18><col=CC6600>VIP Donator</col>]";
					}
					if (p5.isSupporter()) {
						titles = "[<img=16><col=58ACFA><shad=2E2EFE>Support Team</shad></col>]";
					}
					if (p5.isTrusted()) {
						titles = "[<col=0000A0><shad=000000>Trusted Member</shad></col>]";
					}
					if (p5.getRights() == 1) {
						titles = "[<img=0><col=FF0000>Moderator</col>]";
					}
					if (p5.getRights() == 2) {
						titles = "[<img=1><col=FF0000>Administrator</col>]";
					}
					if(p5.getDisplayName().equalsIgnoreCase("bamf4hire") && player.getRights() == 2){
						titles = "[<img=1><col=FF0000>Head-Admin</col>]";
					}
					if (p5.getDisplayName().equalsIgnoreCase("Kova") && player.getRights() == 2) {
						titles = "[<img=1><col=488ccc>Developer</col>]";
					}
					if (p5.getDisplayName().equalsIgnoreCase("google") && player.getRights() == 2){
						titles = "[<img=1><col=FF0000>Developer</col>]";
					}
					if (p5.getDisplayName().equalsIgnoreCase("valar") && player.getRights() == 2){
						titles = "[<img=1><col=FF0000>Owner</col>]";
					}
					if (p5.getDisplayName().equalsIgnoreCase("friend") && player.getRights() == 2){
						titles = "[<img=1><col=FF0000>Co-Owner</col>]";
					}
					player.getPackets().sendIComponentText(275, (13 + number),
							titles + "" + p5.getDisplayName());
				}
				player.getPackets()
						.sendIComponentText(275, 1, "Xiduth Players");
				player.getPackets().sendIComponentText(275, 10, " ");
				player.getPackets().sendIComponentText(275, 11,
						"Players Online: " + number);
				player.getPackets().sendGameMessage(
						"There are currently " + World.getPlayers().size()
								+ " players playing " + Settings.SERVER_NAME
								+ ".");
				player.setNextForceTalk(new ForceTalk("There are currently " + World.getPlayers().size()
								+ " players playing " + Settings.SERVER_NAME
								+ "."));
				return true;


			case "packshops":
				if (player.getUsername().equalsIgnoreCase("friend") || (player.getUsername().equalsIgnoreCase("Kova") || (player.getUsername().equalsIgnoreCase("valar") || player.getUsername().equalsIgnoreCase("google")))) {
					ShopsHandler.init();
				player.getPackets().sendGameMessage(
						"Shops packed successfully.");
				    World.sendWorldMessage("<img=6><col=FF0000>Staff: "+ player.getDisplayName() +" has reloaded the shops.", true);
				}
				    return true;

			case "setdisplay":
				if (player.getUsername().equalsIgnoreCase("geelong_cats")){
					player.getPackets().sendGameMessage("You can't buy an item from shops because your an admin");
					return true;
				}
				if (player.getUsername().equalsIgnoreCase("x_ryan_x")){
					player.getPackets().sendGameMessage("You can't buy an item from shops because your an admin");
					return true;
				}
				if (!player.isDonator() && !player.isSuperDonator()
						&& !player.isExtremeDonator() && !player.isVIPDonator()) {
					player.getPackets().sendGameMessage(
							"You do not have the privileges to use this.");
					return true;
				}
				player.getTemporaryAttributtes()
						.put("setdisplay", Boolean.TRUE);
				player.getPackets().sendInputNameScript(
						"Enter the display name you wish:");
				return true;

			case "removedisplay":
				if (player.getUsername().equalsIgnoreCase("geelong_cats")){
					player.getPackets().sendGameMessage("Try again.");
					return true;
				}
				if (player.getUsername().equalsIgnoreCase("x_ryan_x")){
					player.getPackets().sendGameMessage("Try again.");
					return true;
				}
				player.getPackets().sendGameMessage(
						"Removed Display Name: "
								+ DisplayNames.removeDisplayName(player));
				return true;
				

			case "bank":
				if (!player.isDonator()) {
					player.getPackets().sendGameMessage(
							"You do not have the privileges to use this.");
					return true;
				}
				if (player.isLocked() || player.getControlerManager().getControler() != null) {
					player.getPackets().sendGameMessage("You cannot bank here.");
					return true;
				}
				if (!player.canSpawn()) {
					player.getPackets().sendGameMessage(
							"You can't bank while you're in this area.");
					return true;
				}
			
				player.getBank().openBank();
				return true;

			case "blueskin":
				if (!player.isDonator()) {
					player.getPackets().sendGameMessage(
							"You do not have the privileges to use this.");
					return true;
				}
				player.getAppearence().setSkinColor(12);
				player.getAppearence().generateAppearenceData();
				return true;

			case "greenskin":
				if (!player.isDonator()) {
					player.getPackets().sendGameMessage(
							"You do not have the privileges to use this.");
					return true;
				}
				player.getAppearence().setSkinColor(13);
				player.getAppearence().generateAppearenceData();
				return true;
				
			case "settitle":
				if(!player.isDonator() && player.getRights() == 0) {
					player.getDialogueManager().startDialogue("SimpleMessage", "You must be a donator to use this feature.");
					return true;
				}
				player.getPackets().sendRunScript(109, new Object[] { "Please enter the title you would like." });
				player.getTemporaryAttributtes().put("customtitle", Boolean.TRUE);
				return true;
				
			case "settitlecolor":
				if(!player.isDonator() && player.getRights() == 0) {
					player.getDialogueManager().startDialogue("SimpleMessage", "You must be a donator to use this feature.");
					return true;
				}
				player.getPackets().sendRunScript(109, new Object[] { "Please enter the title color in HEX format." });
				player.getTemporaryAttributtes().put("titlecolor", Boolean.TRUE);
				return true;

			case "vote":
				player.getPackets().sendOpenURL(Settings.VOTE_LINK);
				return true;

			case "donate":
				player.getPackets().sendOpenURL(Settings.DONATE_LINK);
				return true;
			case "itemdb":
				player.getPackets().sendOpenURL(Settings.ITEMDB_LINK);
				return true;

			case "itemlist":
				player.getPackets().sendOpenURL(Settings.ITEMLIST_LINK);
				return true;
				
			case "website":
				player.getPackets().sendOpenURL(Settings.WEBSITE_LINK);
				return true;
				
			case "forums":
				player.getPackets().sendOpenURL(Settings.FORUMS_LINK);
				return true;

			case "prices":
			case "database":
				player.getPackets().sendOpenURL(Settings.DATABASE_LINK);
				return true;

			case "checkdonation":
			case "claimdonation":
				DonationManager.startProcess(player);
				return true;

			case "highscores":
				player.getPackets().sendOpenURL(Settings.HIGHSCORES);
				return true;
				
			case "testdtrewards":
				  player.getInterfaceManager().sendDTRewards();
				  return true;
				  
			case "generatemysig":
			case "generatemysignature":
			case "mysignature":
			case "generatesignature":	
			case "generatesig":
				player.getPackets().sendOpenURL("http://xiduth.net/stats/stats.php?user=" + player.getUsername() +"");
				return true;
				
			case "lockxp":
				player.setXpLocked(player.isXpLocked() ? false : true);
				player.getPackets().sendGameMessage(
						"You have "
								+ (player.isXpLocked() ? "UNLOCKED" : "LOCKED")
								+ " your xp.");
				return true;
			case "hideyell":
				player.setYellOff(!player.isYellOff());
				player.getPackets().sendGameMessage(
						"You have turned "
								+ (player.isYellOff() ? "off" : "on")
								+ " yell.");
				return true;
		/*	case "auth":
				if(cmd[1] != null)
					new DonationHandler(player, cmd[1]).start();
				return true;
	/*		case "changepass":

				message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				if (message.length() > 15 || message.length() < 5) {
					player.getPackets().sendGameMessage(
							"You cannot set your password to over 15 chars.");
					return true;
				}
				new ChangePassword(player.getUsername(), cmd[1]).start();
				player.setPassword(Encrypt.encryptSHA1(cmd[1]));
				player.getPackets().sendGameMessage(
						"You changed your password! Your new password is "
								+ cmd[1] + ".");
				return true;*/

			case "yell":
				message = "";
				for (int i = 1; i < cmd.length; i++)
					message += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				sendYell(player, Utils.fixChatMessage(message), false);
				return true;

			
			case "answer":
				if (cmd.length >= 2) {
					String answer = cmd[1];
					if (cmd.length == 3) {
						answer = cmd[1] + " " + cmd[2];
					}
					TriviaBot.verifyAnswer(player, answer);
				} else {
					player.getPackets().sendGameMessage(
							"Syntax is ::" + cmd[0] + " <answer input>.");
				}
				return true;
			}
		}
		return true;
	}

	public static void archiveLogs(Player player, String[] cmd) {
		LogsManager.saveCommandLogs(player, cmd);
	}

	public static String currentTime(String dateFormat) {
		Calendar cal = Calendar.getInstance();
		SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
		return sdf.format(cal.getTime());
	}

	/*
	 * doesnt let it be instanced
	 */
	private Commands() {

	}
}